What is ContentPresenter?

Thursday, August 13, 2009


It is used to present content which can be a text,image ,CLR objects, XML ,etc. It is a part of WPF.


www.codecollege.NET

What are the disadvantages of LINQ over Stored Procedures ?


1.Network traffic: LINQ needs to send the entire query over the network whereas the SP need only to send sproc-name and argument.

2.Control over DB: LINQ has lesser control over DB compared to SPs as they run within the DB.


www.codecollege.NET

What is the Expansion of CSS ?


Cascaded Style sheet.


www.codecollege.NET

Full Functional sample for ASP.NET FileUpload Server Control

Wednesday, August 12, 2009


The following example will save the uploaded file in the root folder of your application.

Default.aspx
============
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:FileUpload ID="fupTest" runat="server" />&nbsp;
<asp:Button ID="btnUpload" runat="server" OnClick="btnUpload_Click" Text="Upload" />
<br />
<asp:Label ID="lblStatus" runat="server"></asp:Label></div>
</form>
</body>
</html>

Default.aspx.cs
============
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.IO;
public partial class _Default : System.Web.UI.Page
{

protected void btnUpload_Click(object sender, EventArgs e)
{
if (fupTest.HasFile )
{
try
{
string strFileName = Path.GetFileName(fupTest.FileName);
fupTest.SaveAs(Server.MapPath("~/") + strFileName);
lblStatus.Text = "File Uploaded Successfully";
}
catch (Exception ex)
{
lblStatus.Text = "Error File could not be uploaded. The Reason for Failure is: " + ex.Message;
}
}

}
}


www.codecollege.NET

ASP.NET FileUpload Server Control Sample 1


<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:FileUpload ID="FileUpload1" runat="server" /></div>
</form>
</body>
</html>


www.codecollege.NET

.NET 3.0, Abbreviations and Expansions, Glossary,

What is the Expansion of ADO.NET MARS ?


Multiple Active Result Sets.


www.codecollege.NET

What is the Expansion of MOSS 2007 ?


Microsoft Office Sharepoint Server 2007.


www.codecollege.NET
Blog Widget by LinkWithin