ASP.Net Home
Introduction Of ASP.Net
Architecture of asp .net
ASP.Net Life cycle
State Management in asp.net
Cookies in asp.net
Server side state management
Master Page In asp.net
Gridview control
types Of control in asp.net
All Gridview code in asp.net
Reflection in asp .net
Tracing in asp .net
What is virtual directory
Web Service with ASP.NET Basic Tutorials
Java Script in ASP.Net
Ajax In Asp.net
ASP.net basic examples in easy ways
How to bind data in DropDownList control
How to encypt data and decrypt data In asp .net
Add Flash file in website in asp .net
How to make setup of web application
How to send email using asp .net
How to save image in database
How to Calculate Textbox value Using JavaScript in ASP.NET
How to change page theme dynamically at runtime in asp.net
ASP.Net subjective question
ASP.Net Objective question
ASP.Net FAQS
Can the action attribute of a server-side
No, You have to use Server.Transfer to pass the data to another page.
How to Configure SMTP in asp .NET?
This example specifies SMTP parameters to send e-mail using a remote SMTP server and user that are importent. This program shows configuration process-<system.net><mailSettings><smtp deliveryMethod=\"Network|PickupDirectoryFromIis|SpecifiedPickupDirec><network defaultCredentials=\"true|false\"from=\"r4r@fco.in\"host=\"smtphost\"port=\"26\"password=\"password\"userName=\"user\"/><specifiedPickupDirectory pickupDirectoryLocation=\"c:pickupDirectory\"/></smtp></mailSettings></system.net>
This example specifies SMTP parameters to send e-mail using a remote SMTP server and user that are importent. This program shows configuration process-
<system.net><mailSettings><smtp deliveryMethod=\"Network|PickupDirectoryFromIis|SpecifiedPickupDirec><network defaultCredentials=\"true|false\"from=\"r4r@fco.in\"host=\"smtphost\"port=\"26\"password=\"password\"userName=\"user\"/><specifiedPickupDirectory pickupDirectoryLocation=\"c:pickupDirectory\"/></smtp></mailSettings></system.net>
<system.net>
<mailSettings>
<smtp
deliveryMethod=\"Network|PickupDirectoryFromIis|SpecifiedPickupDirec>
<network
defaultCredentials=\"true|false\"
from=\"r4r@fco.in\"
host=\"smtphost\"
port=\"26\"
password=\"password\"
userName=\"user\"/>
<specifiedPickupDirectory
pickupDirectoryLocation=\"c:pickupDirectory\"/>
</smtp>
</mailSettings>
</system.net>
Print Hello World message using SharePoint in Asp.Net 2.0?
using System;using System.Collections.Generic;using System.Text;using System.Web.UI.HtmlControls;using System.Web.UI.WebControls;using Microsoft.SharePoint.WebPartPages;namespace LoisAndClark.WPLibrary{public class MYWP : WebPart{protected override void CreateChildControls(){Content obj = new Content();string str1 = obj.MyContent<string>(\"Hello World!\");this.Controls.Add(new System.Web.UI.LiteralControl(str1));}}} generic method shows that SharePoint site is running on .NET Framework2.0, and the code of the generic method seems like this:public string MyContent<MyType>(MyType arg){return arg.ToString();}
using System;
using System.Collections.Generic;
using System.Text;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using Microsoft.SharePoint.WebPartPages;
namespace LoisAndClark.WPLibrary
{
public class MYWP : WebPart
protected override void CreateChildControls()
Content obj = new Content();
string str1 = obj.MyContent<string>(\"Hello World!\");
this.Controls.Add(new System.Web.UI.LiteralControl(str1));
}
generic method shows that SharePoint site is running on .NET Framework
2.0, and the code of the generic method seems like this:
public string MyContent<MyType>(MyType arg)
return arg.ToString();
How to create a SharePoint web part using File upload control.give example?
using System;using System.Collections.Generic;using System.Text;using System.Web.UI.HtmlControls;using System.Web.UI.WebControls;using Microsoft.SharePoint.WebPartPages;namespace LoisAndClark.WPLibrary{public class MYWP : WebPart{FileUpload objFileUpload = new FileUpload();protected override void CreateChildControls(){this.Controls.Add(new System.Web.UI.LiteralControl(\"Select a file to upload:\"));this.Controls.Add(objFileUpload);Button btnUpload = new Button();btnUpload.Text = \"Save File\";this.Load += new System.EventHandler(btnUpload_Click);this.Controls.Add(btnUpload);}private void btnUpload_Click(object sender, EventArgs e){string strSavePath = @\"C:temp\";if (objFileUpload.HasFile){string strFileName = objFileUpload.FileName;strSavePath += strFileName;objFileUpload.SaveAs(strSavePath);}else{//otherwise let the message show file was not uploaded.}}}}
FileUpload objFileUpload = new FileUpload();
this.Controls.Add(new System.Web.UI.LiteralControl
(\"Select a file to upload:\"));
this.Controls.Add(objFileUpload);
Button btnUpload = new Button();
btnUpload.Text = \"Save File\";
this.Load += new System.EventHandler(btnUpload_Click);
this.Controls.Add(btnUpload);
private void btnUpload_Click(object sender, EventArgs e)
string strSavePath = @\"C:temp\";
if (objFileUpload.HasFile)
string strFileName = objFileUpload.FileName;
strSavePath += strFileName;
objFileUpload.SaveAs(strSavePath);
else
//otherwise let the message show file was not uploaded.
What is BulletedList Control in Share Point. Give an example?
Bullet style allow u choose the style of the element that precedes the item.here u can choose numbers, squares, or circles.here child items can be rendered as plain text, hyperlinks, or buttons.This example uses a custom image that requires to be placed in a virtual directory on the server.using System;using System.Collections.Generic;using System.Text;using System.Web.UI.HtmlControls;using System.Web.UI.WebControls;using Microsoft.SharePoint.WebPartPages;namespace LoisAndClark.WPLibrary{public class MyWP : WebPart{protected override void CreateChildControls {BulletedList objBullist = new BulletedList();objBullist.BulletStyle = BulletStyle.CustomImage;objBullist.BulletImageUrl = @\"/_layouts/images/rajesh.gif\";objBullist.Items.Add(\"First\");objBullist.Items.Add(\"Seciond\");objBullist.Items.Add(\"Third\");objBullist.Items.Add(\"Fourth\");this.Controls.Add(objBullist);}}}
Bullet style allow u choose the style of the element that precedes the item.here u can choose numbers, squares, or circles.here child items can be rendered as plain text, hyperlinks, or buttons.
This example uses a custom image that requires to be placed in a virtual directory on the server.
using System;using System.Collections.Generic;using System.Text;using System.Web.UI.HtmlControls;using System.Web.UI.WebControls;using Microsoft.SharePoint.WebPartPages;namespace LoisAndClark.WPLibrary{public class MyWP : WebPart{protected override void CreateChildControls {BulletedList objBullist = new BulletedList();objBullist.BulletStyle = BulletStyle.CustomImage;objBullist.BulletImageUrl = @\"/_layouts/images/rajesh.gif\";objBullist.Items.Add(\"First\");objBullist.Items.Add(\"Seciond\");objBullist.Items.Add(\"Third\");objBullist.Items.Add(\"Fourth\");this.Controls.Add(objBullist);}}}
public class MyWP : WebPart
protected override void CreateChildControls
BulletedList objBullist = new BulletedList();
objBullist.BulletStyle = BulletStyle.CustomImage;
objBullist.BulletImageUrl = @\"/_layouts/images/rajesh.gif\";
objBullist.Items.Add(\"First\");
objBullist.Items.Add(\"Seciond\");
objBullist.Items.Add(\"Third\");
objBullist.Items.Add(\"Fourth\");
this.Controls.Add(objBullist);
DescribeWizard server control with example in Share Point?
This control enables you to build a sequence of steps that are displayed to theend users side. It is alos used either display or gather information in small steps in system.using System;using System.Collections.Generic;using System.Text;using System.Web.UI.HtmlControls;using System.Web.UI.WebControls;using Microsoft.SharePoint.WebPartPages;namespace LoisAndClark.WPLibrary{public class MyWP : WebPart{protected override void CreateChildControls(){Wizard objWizard = new Wizard();objWizard.HeaderText = \"Wizard Header\";for (int i = 1; i <= 6; i++){WizardStepBase objStep = new WizardStep();objStep.ID = \"Step\" + i;objStep.Title = \"Step \" + i;TextBox objText = new TextBox();objText.ID = \"Text\" + i;objText.Text = \"Value for step \" + i;objStep.Controls.Add(objText);objWizard.WizardSteps.Add(objStep);}this.Controls.Add(objWizard);}}}
This control enables you to build a sequence of steps that are displayed to the
end users side. It is alos used either display or gather information in small steps in system.
using System;using System.Collections.Generic;using System.Text;using System.Web.UI.HtmlControls;using System.Web.UI.WebControls;using Microsoft.SharePoint.WebPartPages;namespace LoisAndClark.WPLibrary{public class MyWP : WebPart{protected override void CreateChildControls(){Wizard objWizard = new Wizard();objWizard.HeaderText = \"Wizard Header\";for (int i = 1; i <= 6; i++){WizardStepBase objStep = new WizardStep();objStep.ID = \"Step\" + i;objStep.Title = \"Step \" + i;TextBox objText = new TextBox();objText.ID = \"Text\" + i;objText.Text = \"Value for step \" + i;objStep.Controls.Add(objText);objWizard.WizardSteps.Add(objStep);}this.Controls.Add(objWizard);}}}
Wizard objWizard = new Wizard();
objWizard.HeaderText = \"Wizard Header\";
for (int i = 1; i <= 6; i++)
WizardStepBase objStep = new WizardStep();
objStep.ID = \"Step\" + i;
objStep.Title = \"Step \" + i;
TextBox objText = new TextBox();
objText.ID = \"Text\" + i;
objText.Text = \"Value for step \" + i;
objStep.Controls.Add(objText);
objWizard.WizardSteps.Add(objStep);
this.Controls.Add(objWizard);
Define Life Cycle of Page in ASP.NET?
protected void Page_PreLoad(object sender, EventArgs e) { Response.Write(\"<br>\"+\"Page Pre Load\"); } protected void Page_Load(object sender, EventArgs e) { Response.Write(\"<br>\" + \"Page Load\"); } protected void Page_LoadComplete(object sender, EventArgs e) { Response.Write(\"<br>\" + \"Page Complete\"); } protected void Page_PreRender(object sender, EventArgs e) { Response.Write(\"<br>\" + \"Page Pre Render\"); } protected void Page_Render(object sender, EventArgs e) { Response.Write(\"<br>\" + \"Pre Render\"); } protected void Page_PreInit(object sender, EventArgs e) { Response.Write(\"<br>\" + \"Page Pre Init\"); } protected void Page_Init(object sender, EventArgs e) { Response.Write(\"<br>\" + \"Page Init\"); } protected void Page_InitComplete(object sender, EventArgs e) { Response.Write(\"<br>\" + \"Page Pre Init Complete\"); }
protected void Page_PreLoad(object sender, EventArgs e)
Response.Write(\"<br>\"+\"Page Pre Load\");
protected void Page_Load(object sender, EventArgs e)
Response.Write(\"<br>\" + \"Page Load\");
protected void Page_LoadComplete(object sender, EventArgs e)
Response.Write(\"<br>\" + \"Page Complete\");
protected void Page_PreRender(object sender, EventArgs e)
Response.Write(\"<br>\" + \"Page Pre Render\");
protected void Page_Render(object sender, EventArgs e)
Response.Write(\"<br>\" + \"Pre Render\");
protected void Page_PreInit(object sender, EventArgs e)
Response.Write(\"<br>\" + \"Page Pre Init\");
protected void Page_Init(object sender, EventArgs e)
Response.Write(\"<br>\" + \"Page Init\");
protected void Page_InitComplete(object sender, EventArgs e)
Response.Write(\"<br>\" + \"Page Pre Init Complete\");
Write a program in ASP.NET to Show Data With Access?
Page_Load():- OleDbConnection x; OleDbCommand y; OleDbDataReader z; protected void Page_Load(object sender, EventArgs e) { x = new OleDbConnection(\"provider=microsoft.jet.oledb.4.0;data source=c:\\db1.mdb\"); x.Open(); y = new OleDbCommand(\"select * from emp\", x); z = y.ExecuteReader(); while (z.Read()) { Response.Write(z[\"ename\"]); Response.Write(\"<hr>\"); } z.Close(); y.Dispose(); x.Close(); }
Page_Load():-
OleDbConnection x; OleDbCommand y; OleDbDataReader z; protected void Page_Load(object sender, EventArgs e) { x = new OleDbConnection(\"provider=microsoft.jet.oledb.4.0;data source=c:\\db1.mdb\"); x.Open(); y = new OleDbCommand(\"select * from emp\", x); z = y.ExecuteReader(); while (z.Read()) { Response.Write(z[\"ename\"]); Response.Write(\"<hr>\"); } z.Close(); y.Dispose(); x.Close(); }
OleDbConnection x;
OleDbCommand y;
OleDbDataReader z;
x = new OleDbConnection(\"provider=microsoft.jet.oledb.4.0;data source=c:\\db1.mdb\");
x.Open();
y = new OleDbCommand(\"select * from emp\", x);
z = y.ExecuteReader();
while (z.Read())
Response.Write(z[\"ename\"]);
Response.Write(\"<hr>\");
z.Close();
y.Dispose();
x.Close();
Write a program to show connection with Oracle in ASP.NET?
OleDbConnection x; OleDbCommand y; OleDbDataReader z; protected void Page_Load(object sender, EventArgs e) { x = new OleDbConnection(\"provider=msdaora;user id=scott;password=tiger\"); x.Open(); y = new OleDbCommand(\"select * from emp\", x); z = y.ExecuteReader(); while (z.Read()) { Response.Write(\"<li>\"); Response.Write(z[\"ename\"]); } z.Close(); y.Dispose(); x.Close(); }
x = new OleDbConnection(\"provider=msdaora;user id=scott;password=tiger\");
Response.Write(\"<li>\");
Write a program to show connection to Excel in ASP.NET?
OleDbConnection x; OleDbCommand y; OleDbDataReader z; protected void Page_Load(object sender, EventArgs e) { x = new OleDbConnection(\"provider=microsoft.jet.oledb.4.0;data source=c:\\book1.xls;Extended Properties=excel 8.0\"); x.Open(); y = new OleDbCommand(\"select * from [sheet1$]\", x); z = y.ExecuteReader(); while (z.Read()) { Response.Write(\"<li>\"); Response.Write(z[\"ename\"]); } z.Close(); y.Dispose(); x.Close(); }
x = new OleDbConnection(\"provider=microsoft.jet.oledb.4.0;data source=c:\\book1.xls;Extended Properties=excel 8.0\");
y = new OleDbCommand(\"select * from [sheet1$]\", x);
How to add Record in ASP.NET?
OleDbConnection x; OleDbCommand y; protected void Button1_Click(object sender, EventArgs e) { x = new OleDbConnection(\"provider=microsoft.jet.oledb.4.0;data source=c:\\db1.mdb\"); x.Open(); y = new OleDbCommand(\"Insert into emp(empno,ename,sal) values(@p,@q,@r)\", x); y.Parameters.Add(\"@p\", TextBox1.Text); y.Parameters.Add(\"@q\", TextBox2.Text); y.Parameters.Add(\"@r\", TextBox3.Text); y.ExecuteNonQuery(); Label1.Visible = true; Label1.Text=\"Record Addedd\"; y.Dispose(); x.Close(); }
protected void Button1_Click(object sender, EventArgs e)
y = new OleDbCommand(\"Insert into emp(empno,ename,sal) values(@p,@q,@r)\", x);
y.Parameters.Add(\"@p\", TextBox1.Text);
y.Parameters.Add(\"@q\", TextBox2.Text);
y.Parameters.Add(\"@r\", TextBox3.Text);
y.ExecuteNonQuery();
Label1.Visible = true;
Label1.Text=\"Record Addedd\";
Write a program to Delete Record in ASP.NET ?
OleDbConnection x; OleDbCommand y; protected void Button1_Click(object sender, EventArgs e) { x = new OleDbConnection(\"provider=microsoft.jet.oledb.4.0;data source=c:\\db1.mdb\"); x.Open(); y = new OleDbCommand(\"delete from emp where empno=@p\",x); y.Parameters.Add(\"@p\", TextBox1.Text); y.ExecuteNonQuery(); Label1.Visible = true; Label1.Text=\"Record Deleted\"; y.Dispose(); x.Close(); }
y = new OleDbCommand(\"delete from emp where empno=@p\",x);
Label1.Text=\"Record Deleted\";
Write a program to show data in Gridview in ASP.NET?
OleDbConnection x; OleDbDataAdapter y; DataSet z; protected void Button2_Click(object sender, EventArgs e) { x = new OleDbConnection(\"provider=msdaora;user id=scott;password=tiger\"); x.Open(); y = new OleDbDataAdapter(\"select * from emp\", x); z = new DataSet(); y.Fill(z, \"emp\"); GridView1.DataSource = z.Tables[\"emp\"]; GridView1.DataBind(); y.Dispose(); x.Close(); }
OleDbDataAdapter y;
DataSet z;
protected void Button2_Click(object sender, EventArgs e)
y = new OleDbDataAdapter(\"select * from emp\", x);
z = new DataSet();
y.Fill(z, \"emp\");
GridView1.DataSource = z.Tables[\"emp\"];
GridView1.DataBind();
Write a Program to Connect with dropdownlist in ASP.NET
OleDbConnection x; OleDbDataAdapter y; DataSet z; protected void Button1_Click(object sender, EventArgs e) { x = new OleDbConnection(\"Provider=msdaora;user id=scott;password=tiger\"); x.Open(); y=new OleDbDataAdapter(\"select * from emp\",x); z = new DataSet(); y.Fill(z, \"emp\"); DropDownList1.DataSource = z; DropDownList1.DataTextField = \"ename\"; DropDownList1.DataBind(); x.Close(); }
x = new OleDbConnection(\"Provider=msdaora;user id=scott;password=tiger\");
y=new OleDbDataAdapter(\"select * from emp\",x);
DropDownList1.DataSource = z;
DropDownList1.DataTextField = \"ename\";
DropDownList1.DataBind();
How Repeater is used in ASP.NET?
<asp:Repeater ID=\"Repeater1\" runat=\"server\"> <ItemTemplate> <%#DataBinder.Eval(Container.DataItem, \"Empno\") %> <%#DataBinder.Eval(Container.DataItem, \"Ename\") %> <%#DataBinder.Eval(Container.DataItem, \"Sal\") %> </ItemTemplate> </asp:Repeater>//the whole structure looks like this<asp:Repeater ID=\"Repeater1\" runat=\"server\"><HeaderTemplate> Employee Detailed</HeaderTemplate> <ItemTemplate> <font color=gray> <%#DataBinder.Eval(Container.DataItem, \"Empno\") %> <%#DataBinder.Eval(Container.DataItem, \"Ename\") %> <%#DataBinder.Eval(Container.DataItem, \"Sal\") %> </font> </ItemTemplate> <AlternatingItemTemplate> <font color=green> <%#DataBinder.Eval(Container.DataItem, \"Empno\") %> <%#DataBinder.Eval(Container.DataItem, \"Ename\") %> <%#DataBinder.Eval(Container.DataItem, \"Sal\") %> </font> </AlternatingItemTemplate> <FooterTemplate> Thanks </FooterTemplate> <SeparatorTemplate> <hr/> </SeparatorTemplate> </asp:Repeater>
<asp:Repeater ID=\"Repeater1\" runat=\"server\"> <ItemTemplate>
<%#DataBinder.Eval(Container.DataItem, \"Empno\") %>
<%#DataBinder.Eval(Container.DataItem, \"Ename\") %>
<%#DataBinder.Eval(Container.DataItem, \"Sal\") %>
</ItemTemplate>
</asp:Repeater>
//the whole structure looks like this
<asp:Repeater ID=\"Repeater1\" runat=\"server\">
<HeaderTemplate>
Employee Detailed
</HeaderTemplate>
<ItemTemplate>
<font color=gray>
</font>
<AlternatingItemTemplate>
<font color=green>
</AlternatingItemTemplate>
<FooterTemplate>
Thanks
</FooterTemplate>
<SeparatorTemplate>
<hr/>
</SeparatorTemplate>
How to show data in HTML table using Repeater?
<asp:Repeater ID=\"Repeater1\" runat=\"server\"> <HeaderTemplate> <table border=\"10\" width=\"100%\" bgcolor=green style=\"width:100%\" > <tr> <th>Empno</th> <th>Ename</th> <th>Sal</th> </tr> </HeaderTemplate> <ItemTemplate> <tr> <td> <%#DataBinder.Eval(Container.DataItem, \"Empno\") %> </td> <td> <%#DataBinder.Eval(Container.DataItem, \"Ename\") %> </td> <td> <%#DataBinder.Eval(Container.DataItem, \"Sal\") %> </td> </tr> </font> </ItemTemplate> <FooterTemplate> </table> </FooterTemplate> </asp:Repeater> </td> <td style=\"width: 100px; height: 226px\"> </td> </tr> </table>
<table border=\"10\" width=\"100%\" bgcolor=green style=\"width:100%\" >
<tr>
<th>Empno</th> <th>Ename</th> <th>Sal</th>
</tr>
<td>
</td>
</table>
<td style=\"width: 100px; height: 226px\">
Write a program to show the Use of dataList in ASP.NET?
<asp:DataList ID=\"DataList1\" runat=\"server\" BackColor=\"White\" BorderColor=\"#336666\" BorderStyle=\"Double\" BorderWidth=\"3px\" CellPadding=\"4\" GridLines=\"Both\"> <HeaderTemplate>Employee Detailed</HeaderTemplate> <ItemTemplate> <%#DataBinder.Eval(Container.DataItem, \"Empno\") %> <%#DataBinder.Eval(Container.DataItem, \"Ename\") %> <%#DataBinder.Eval(Container.DataItem, \"Sal\") %> </ItemTemplate>
<asp:DataList ID=\"DataList1\" runat=\"server\" BackColor=\"White\" BorderColor=\"#336666\" BorderStyle=\"Double\" BorderWidth=\"3px\" CellPadding=\"4\" GridLines=\"Both\">
<HeaderTemplate>Employee Detailed</HeaderTemplate>
How to make User Control in ASP.net?
a) Add User Controllwrite code:-<hr color=red/><center><H1><SPAN style=\"COLOR: #ff9999; TEXT-DECORATION: underline\">BigBanyanTree.com</SPAN></H1></center> <hr Color=Green/>b) In .aspx page:-<%@ Register TagPrefix=a TagName=\"MyUserCtl\" Src=\"~/WebUserControl.ascx\"%>c) Now use this :- <a:MyUserCtl ID=\"tata\" runat=server/>
a) Add User Controll
write code:-
<hr color=red/>
<center><H1><SPAN
style=\"COLOR: #ff9999; TEXT-DECORATION: underline\">BigBanyanTree.com</SPAN></H1></center>
<hr Color=Green/>
b) In .aspx page:-
<%@ Register TagPrefix=a TagName=\"MyUserCtl\" Src=\"~/WebUserControl.ascx\"%>
c) Now use this :-
<a:MyUserCtl ID=\"tata\" runat=server/>
What is Benefits of ASP.NET?
>>Simplified development: ASP.NET offers a very rich object model that developers can use to reduce the amount of code they need to write.>>Web services:Create Web services that can be consumed by any client that understands HTTP andXML, the de facto language for inter-device communication.>>Performance:When ASP.NET page is first requested, it is compiled and cached, or saved in memory, bythe .NET Common Language Runtime (CLR). This cached copy can then be re-used foreach subsequent request for the page. Performance is thereby improved because afterthe first request, the code can run from a much faster compiled version.>>Language independence>>Simplified deployment>>Cross-client capability
>>Simplified development:
ASP.NET offers a very rich object model that developers can use to reduce the amount of code they need to write.
>>Web services:
Create Web services that can be consumed by any client that understands HTTP and
XML, the de facto language for inter-device communication.
>>Performance:
When ASP.NET page is first requested, it is compiled and cached, or saved in memory, by
the .NET Common Language Runtime (CLR). This cached copy can then be re-used for
each subsequent request for the page. Performance is thereby improved because after
the first request, the code can run from a much faster compiled version.
>>Language independence
>>Simplified deployment
>>Cross-client capability
How does cookies work in ASP.Net?
Using Cookies in web pages is very useful for temporarily storing small amounts of data, for the website to use. These Cookies are small text files that are stored on the user\'s computer, which the web site can read for information; a web site can also write new cookies.An example of using cookies efficiently would be for a web site to tell if a user has already logged in. The login information can be stored in a cookie on the user\'s computer and read at any time by the web site to see if the user is currently logged in. This enables the web site to display information based upon the user\'s current status - logged in or logged out.
Using Cookies in web pages is very useful for temporarily storing small amounts of data, for the website to use. These Cookies are small text files that are stored on the user\'s computer, which the web site can read for information; a web site can also write new cookies.
An example of using cookies efficiently would be for a web site to tell if a user has already logged in. The login information can be stored in a cookie on the user\'s computer and read at any time by the web site to see if the user is currently logged in. This enables the web site to display information based upon the user\'s current status - logged in or logged out.
Difference Between Thread and Processs?
Process is a program in execution where thread is a seprate part of execution in the program.Thread is a part of process. process is the collection of thread.
Process is a program in execution where thread is a seprate part of execution in the program.
Thread is a part of process. process is the collection of thread.
What is the difference between an EXE and a DLL?
DLL: Its a Dynamic Link Library .There are many entry points. The system loads a DLL into the context of an existing thread. Dll cannot Run on its ownEXE: Exe Can Run On its own.exe is a executable file.When a system launches new exe, a new process is created.The entry thread is called in context of main thread of that process.
DLL: Its a Dynamic Link Library .There are many entry points. The system loads a DLL into the context of an existing thread. Dll cannot Run on its own
EXE: Exe Can Run On its own.exe is a executable file.When a system launches new exe, a new process is created.The entry thread is called in context of main thread of that process.
ASP.net Versions ?
ASP .NET version 1.0 was first released in January 2002ASP .NET version 1.1 released in April 2003 (ASP .NET 2003)ASP .NET version 2.0 released in November 2005 (ASP .NET 2005)ASP .NET version 3.5 released in November 2007 (ASP .NET 2008)
ASP .NET version 1.0 was first released in January 2002
ASP .NET version 1.1 released in April 2003 (ASP .NET 2003)
ASP .NET version 2.0 released in November 2005 (ASP .NET 2005)
ASP .NET version 3.5 released in November 2007 (ASP .NET 2008)
What is ASp.net ?
ASP .NET built on .net framework. Asp .net is a web development tool. Asp .net is offered by Microsoft. We can built dynamic websites by using asp .net. Asp .net was first released in January 2002 with version 1.0 of the .net framework. It is the successor of Microsoft\'s ASP. .NET Framework consists of many class libraries, support multiple languages and a common execution platform. Asp .net is a program run in IIS server. Asp .net is also called Asp+. Every element in Asp .net is treated as object and run on server. Asp .net is a event driven programming language. Most html tags are used by Asp .net. Asp .net allows the developer to build applications faster. Asp .net is a server side scripting.
Define File Name Extensions In Asp .net ?
Applications written in Asp .net have different files with different extension. native files generally have .aspx or .ascx extension . Web services have .asmx extension.File name containing the business logic depend on the language that you are using. For Example a c# file have extension aspx.cs.
Applications written in Asp .net have different files with different extension. native files generally have .aspx or .ascx extension . Web services have .asmx extension.
File name containing the business logic depend on the language that you are using.
For Example a c# file have extension aspx.cs.
Difference between Cookies and Session in Asp.Net ?
1.The main difference between cookies and sessions is that cookies are stored in the user\'s browser, and sessions are not. This difference determines what each is best used for.2.A cookie can keep information in the user\'s browser until deleted. If a person has a login and password, this can be set as a cookie in their browser so they do not have to re-login to your website every time they visit. You can store almost anything in a browser cookie3. Sessions are not reliant on the user allowing a cookie. They work instead like a token allowing access and passing information while the user has their browser open. The problem with sessions is that when you close your browser you also lose the session. So, if you had a site requiring a login, this couldn\'t be saved as a session like it could as a cookie, and the user would be forced to re-login every time they visit.
1.The main difference between cookies and sessions is that cookies are stored in the user\'s browser, and sessions are not. This difference determines what each is best used for.
2.A cookie can keep information in the user\'s browser until deleted. If a person has a login and password, this can be set as a cookie in their browser so they do not have to re-login to your website every time they visit. You can store almost anything in a browser cookie
3. Sessions are not reliant on the user allowing a cookie. They work instead like a token allowing access and passing information while the user has their browser open. The problem with sessions is that when you close your browser you also lose the session. So, if you had a site requiring a login, this couldn\'t be saved as a session like it could as a cookie, and the user would be forced to re-login every time they visit.
Types of Debbuger ?
Debugger is another program that is used for testing and debugging purpose of other programs. Most of the time it is using to analyze and examine error conditions in application. It will be able to tell where exactly in your application error occurred,Two Types of Debbuger:1.CorDBG command-line debugger. To use CorDbg, you must compile the original C# file using the /debug switch.2.DbgCLR graphic debugger. Visual Studio .NET uses the DbgCLR.
Debugger is another program that is used for testing and debugging purpose of other programs. Most of the time it is using to analyze and examine error conditions in application. It will be able to tell where exactly in your application error occurred,
Two Types of Debbuger:
1.CorDBG command-line debugger. To use CorDbg, you must compile the original C# file using the /debug switch.
2.DbgCLR graphic debugger. Visual Studio .NET uses the DbgCLR.
What is the Difference Between Compiler and Debugger ?
Compiler is a software or set of soetware that translate one computer Language to another computer.Most cases High level Programming Language to low level Programming Language.Most of the time Program analyzed and examined error then Debugger used.Debugger is another program that is used for testing and debugging purpose of other programs. It will be able to tell where exactly in your application error occurred,and tell the where error occured.
Compiler is a software or set of soetware that translate one computer Language to another computer.Most cases High level Programming Language to low level Programming Language.
Most of the time Program analyzed and examined error then Debugger used.Debugger is another program that is used for testing and debugging purpose of other programs. It will be able to tell where exactly in your application error occurred,and tell the where error occured.
What is the Difference between Compiler and Translator?
Compiler converet the program one computer language to another computer language.in other word high level language to low level language.Traslator traslate one language to many other language like english to hindi,french etc.
Compiler converet the program one computer language to another computer language.in other word high level language to low level language.
Traslator traslate one language to many other language like english to hindi,french etc.
What is Globalization ?
The process to make a Application according to the user from multiple culture.The process involves translating the user interface in to many languages,like using the correct currency, date and time format, calendar, writing direction, sorting rules, and other issues.Accommodating these cultural differences for an application is called Globlization.Three different ways to globalize web applications:1.Detect and redirect approach2.Run-time adjustment approach3.Satellite assemblies approach
The process to make a Application according to the user from multiple culture.The process involves translating the user interface in to many languages,like using the correct currency, date and time format, calendar, writing direction, sorting rules, and other issues.Accommodating these cultural differences for an application is called Globlization.
Three different ways to globalize web applications:
1.Detect and redirect approach
2.Run-time adjustment approach
3.Satellite assemblies approach
What happens when you make changes to an application\'s Web.config file?
When make change in web.config file.IIS restarts application and automatically applies changes.This effect the Session state variable and effect the application,then user adversely affected.
What are the steps to host a web application on a web server?
Step1.Set up a virtual folder for the application using IIS.2. Copy the Web application to the virtual directory.3. Adding the shared .NET components to the servers global assembly cache (GAC).4. Set the security permissions on the server to allow the application to access required resources.
Step1.Set up a virtual folder for the application using IIS.
2. Copy the Web application to the virtual directory.
3. Adding the shared .NET components to the servers global assembly cache (GAC).
4. Set the security permissions on the server to allow the application to access required resources.
What is the difference between Session Cookies and Persistent Cookies?
When client broweses session cookie stored in a memmory.when browser closed session cookie lost.//Code to create a UserName cookie containing the name David.HttpCookie CookieObject = new HttpCookie(\"UserName\", \"David\");Response.Cookies.Add(CookieObject);//Code to read the Cookie created aboveRequest.Cookies[\"UserName\"].Value;Persistent cookie same as the session cookie except that persistent cookie have expiration date.The expiration date indicates to the browser that it should write the cookie to the client\'s hard drive.//Code to create a UserName Persistent Cookie that lives for 10 daysHttpCookie CookieObject = new HttpCookie(\"UserName\", \"David\");CookieObject.Expires = DateTime.Now.AddDays(10);Response.Cookies.Add(CookieObject);//Code to read the Cookie created aboveRequest.Cookies[\"UserName\"].Value;
When client broweses session cookie stored in a memmory.when browser closed session cookie lost.
//Code to create a UserName cookie containing the name David.
HttpCookie CookieObject = new HttpCookie(\"UserName\", \"David\");Response.Cookies.Add(CookieObject);
HttpCookie CookieObject = new HttpCookie(\"UserName\", \"David\");
Response.Cookies.Add(CookieObject);
//Code to read the Cookie created above
Request.Cookies[\"UserName\"].Value;
Persistent cookie same as the session cookie except that persistent cookie have expiration date.The expiration date indicates to the browser that it should write the cookie to the client\'s hard drive.
//Code to create a UserName Persistent Cookie that lives for 10 days
HttpCookie CookieObject = new HttpCookie(\"UserName\", \"David\");CookieObject.Expires = DateTime.Now.AddDays(10);Response.Cookies.Add(CookieObject);//Code to read the Cookie created aboveRequest.Cookies[\"UserName\"].Value;
CookieObject.Expires = DateTime.Now.AddDays(10);
What are the advantages and disadvantage of Using Cookies?
Advantage:1.Cookies do not require any server resources since they are stored on the client.2. Cookies are easy to implement.3. Cookies to expire when the browser session ends (session cookies) or they can exist for a specified length of time on the computer (persistent cookies).Disadvantage:1. Users can delete a cookies.2. Users browser can refuse cookies,so your code has to anticipate that possibility.3. Cookies exist as plain text on the client machine and they may security risk as anyone can open and tamper with cookies.
Advantage:
1.Cookies do not require any server resources since they are stored on the client.
2. Cookies are easy to implement.
3. Cookies to expire when the browser session ends (session cookies) or they can exist for a specified length of time on the computer (persistent cookies).
Disadvantage:
1. Users can delete a cookies.
2. Users browser can refuse cookies,so your code has to anticipate that possibility.
3. Cookies exist as plain text on the client machine and they may security risk as anyone can open and tamper with cookies.
Explain Namespace ?
There are many classes in Asp.Net.If Microsoft simply jumbled all the classes together, then you would never find anything. Microsoft divided the classes in the Framework into separate namespaces.All classes working with a file system located in System.Io Namespace. All classes working with SQL data base used System.Data.SqlClient Namespace.The ASP.NET Framework gives you the most commonly used namespaces:. System. System.Collections. System.Collections.Specialized. System.Configuration. System.Text. System.Text.RegularExpressions. System.Web. System.Web.Caching. System.Web.SessionState. System.Web.Security. System.Web.Profile. System.Web.UI. System.Web.UI.WebControls. System.Web.UI.WebControls.WebParts. System.Web.UI.HTMLControls
There are many classes in Asp.Net.If Microsoft simply jumbled all the classes together, then you would never find anything. Microsoft divided the classes in the Framework into separate namespaces.All classes working with a file system located in System.Io Namespace. All classes working with SQL data base used System.Data.SqlClient Namespace.
The ASP.NET Framework gives you the most commonly used namespaces:
. System
. System.Collections
. System.Collections.Specialized
. System.Configuration
. System.Text
. System.Text.RegularExpressions
. System.Web
. System.Web.Caching
. System.Web.SessionState
. System.Web.Security
. System.Web.Profile
. System.Web.UI
. System.Web.UI.WebControls
. System.Web.UI.WebControls.WebParts
. System.Web.UI.HTMLControls
What is CLR?
CLR(Common Language Runtime) provide Environment to debugg and run program and utility developed at the .Net FrameWork.CLR provide memory management, debugging, security, etc. The CLR is also known as Virtual Execution System (VES). The managed and unmanaged code both runs under CLR.Unmanaged code run through the Wrapered Classes.There are many system Utilities run under the CLR.
What is Shallow Copy and Deep Copy in .NET?
Shallow copy:When a object creating and copying nonstatic field of the current object to the new object know as shallow copy.If a field is a value type --> a bit-by-bit copy of the field is performed a reference type --> the reference is copied but the referred object is not; therefore, the original object and its clone refer to the same object.Deep copy:Deep cooy little same as shallow copy,deep copy the whole object and make a different object, it means it do not refer to the original object while in case of shallow copy the target object always refer to the original object and changes in target object also make changes in original object.
Shallow copy:When a object creating and copying nonstatic field of the current object to the new object know as shallow copy.
If a field is a value type --> a bit-by-bit copy of the field is performed
a reference type --> the reference is copied but the referred object is not; therefore, the original object and its clone refer to the same object.
Deep copy:Deep cooy little same as shallow copy,deep copy the whole object and make a different object, it means it do not refer to the original object while in case of shallow copy the target object always refer to the original object and changes in target object also make changes in original object.
Explain Web Services?
Web services are programmable business logic components that provide access to functionality through the Internet. Web services are given the .asmx extension.Standard protocols like HTTP can be used to access them. Web services are based on the Simple Object Access Protocol (SOAP), which is an application of XML.In .Net FrameWork Web services convert your application in to Web Application.which published their functionality to whole world on internet.Web Services like a software system that designed to support interoperable machine-to-machine interaction over a Internet.
What is Postback in Asp.net?
When Frist time reqest to the server PostBack is False.When request or an action occurs (like button click), the page containing all the controls within the <FORM... > tag performs an HTTP POST, while having itself as the target URL. This is called Postback.We can say its a mechanism to allow the communication between client side and server side.
Explain the differences between server-side and client-side code in Asp.Net?
In Asp.Net Environment Server side code or scripting means the script will executed by server as interpreted needed.Server side scripting done the bussines logic like transaction and fetching data to Sever. Client side scripting means that the script will be executed immediately in the browser such as form field validation, clock, email validation, etc. Client side scripting is usually done in VBScript or JavaScript. Since the code is included in the HTML page, anyone can see the code by viewing the page source.
In Asp.Net Environment Server side code or scripting means the script will executed by server as interpreted needed.Server side scripting done the bussines logic like transaction and fetching data to Sever.
Client side scripting means that the script will be executed immediately in the browser such as form field validation, clock, email validation, etc. Client side scripting is usually done in VBScript or JavaScript. Since the code is included in the HTML page, anyone can see the code by viewing the page source.
What is the ASP.NET validation controls?
Validation controls applied on client side scripting.List of Validations:1. RequiredFieldValidator:Makes a input control to required field.2. RangeValidator:Chek the values falls between to values.3. CompareValidator:Compares the value of one input control to the value of another input control or to a fixed value.4. RegularExpressionValidator:Input value matches a specific pattern.5. CustomValidator:Write a Method to validat input.6. ValidationSummary:Displays a report of all validation errors occurred in a Web page.
Validation controls applied on client side scripting.List of Validations:
1. RequiredFieldValidator:Makes a input control to required field.
2. RangeValidator:Chek the values falls between to values.
3. CompareValidator:Compares the value of one input control to the value of another input control or to a fixed value.
4. RegularExpressionValidator:Input value matches a specific pattern.
5. CustomValidator:Write a Method to validat input.
6. ValidationSummary:Displays a report of all validation errors occurred in a Web page.
Describe Paging in ASP.NET?
\"In computer operating systems there are various ways in which the operating system can store and retrieve data from secondary storage for use in main memory\". One such memory management scheme is referred to as paging.In ASP.Net the DataGrid control in ASP.NET enables easy paging of the data. The AllowPaging property of the DataGrid can be set to True to perform paging. ASP.NET automatically performs paging and provides the hyperlinks to the other pages in different styles, based on the property that has been set for PagerStyle.Mode.
What is the difference between Server.Transfer and Response.Redirect?
Response.Redirect:This tells the browser that the requested page can be found at a new location. The browser then initiates another request to the new page loading its contents in the browser. Server.Transfer: It transfers execution from the first page to the second page on the server. As far as the browser client is concerned, it made one request and the initial page is the one responding with content. The benefit of this approach is one less round trip to the server from the client browser.
Response.Redirect:This tells the browser that the requested page can be found at a new location. The browser then initiates another request to the new page loading its contents in the browser.
Server.Transfer: It transfers execution from the first page to the second page on the server. As far as the browser client is concerned, it made one request and the initial page is the one responding with content. The benefit of this approach is one less round trip to the server from the client browser.
What is Data Binding?
Data Binding is binding controls to data from databases.Using Data binding a control to a particular column in a table from the database or we can bind the whole table to the data grid.In other words Data binding is a way used to connect values from a collection of data (e.g. DataSet) to the controls on a web form. The values from the dataset are automatically displayed in the controls without having to write separate code to display them.
Data Binding is binding controls to data from databases.Using Data binding a control to a particular column in a table from the database or we can bind the whole table to the data grid.
In other words Data binding is a way used to connect values from a collection of data (e.g. DataSet) to the controls on a web form. The values from the dataset are automatically displayed in the controls without having to write separate code to display them.
Do Web controls support Cascading Style Sheets?
All Web controls inherit a property named CssClass from the base class \"System.Web.UI. WebControls. WebControl\" which can be used to control the properties of the web control.
What classes are needed to send e-mail from an ASP.NET application?
Following Classes use to sent email from ASP.Net application:1.MailMessage2.SmtpMail Both are classes defined in the .NET Framework Class Library\'s \"System. Web. Mail\" namespace.
Following Classes use to sent email from ASP.Net application:
1.MailMessage
2.SmtpMail
Both are classes defined in the .NET Framework Class Library\'s \"System. Web. Mail\" namespace.
What is ViewState?
State of the object to be stored in hidden field on the page.ViewState is not stored on the server or any other external source. ViewState transported to the client and back to the server. ViewState is used the retain the state of server-side objects between postabacks.Viewstate should be the first choice to save data to access across postbacks.
Define ASP.Net page life cycle in brief ?
1. OnInit (Init): Initializes each child control.2. LoadControlState: Loaded the ControlState of the control. To use this method the control must call the Page.RegisterRequiresControlState method in the OnInit method of the control.3. LoadViewState: Loaded the ViewState of the control.4. LoadPostData: Controls that implement this interface use this method to retrieve the incoming form data and update the control According to there properties.5. Load (OnLoad): Allows actions that are common to every request to be placed here. control is stable at this time, it has been initialized and its state has been reconstructed.6. RaisePostDataChangedEvent: Is defined on the interface IPostBackData-Handler.7. RaisePostbackEvent: Handling the clien side event caused Postback to occur8. PreRender (OnPreRender): Allows last-minute changes to the control. This event takes place before saving ViewState so any changes made here are saved.9. SaveControlState: Saves the current control state to ViewState. 10. SaveViewState: Saves the current data state of the control to ViewState.11. Render: Generates the client-side HTML Dynamic Hypertext Markup Language (DHTML) and script that are necessary to properly display this control at the browser. In this stage any changes to the control are not persisted intoViewState.12. Dispose: Accepts cleanup code. Releases any unman-aged resources in this stage. Unmanaged resources are resources that are not handled by the .NET common language runtime such as file handles and database connections.13. UnLoad
1. OnInit (Init): Initializes each child control.
2. LoadControlState: Loaded the ControlState of the control. To use this method the control must call the Page.RegisterRequiresControlState method in the OnInit method of the control.
3. LoadViewState: Loaded the ViewState of the control.
4. LoadPostData: Controls that implement this interface use this method to retrieve the incoming form data and update the control According to there properties.
5. Load (OnLoad): Allows actions that are common to every request to be placed here. control is stable at this time, it has been initialized and its state has been reconstructed.
6. RaisePostDataChangedEvent: Is defined on the interface IPostBackData-Handler.
7. RaisePostbackEvent: Handling the clien side event caused Postback to occur
8. PreRender (OnPreRender): Allows last-minute changes to the control. This event takes place before saving ViewState so any changes made here are saved.
9. SaveControlState: Saves the current control state to ViewState.
10. SaveViewState: Saves the current data state of the control to ViewState.
11. Render: Generates the client-side HTML Dynamic Hypertext Markup Language (DHTML) and script that are necessary to properly display this control at the browser. In this stage any changes to the control are not persisted into
ViewState.
12. Dispose: Accepts cleanup code. Releases any unman-aged resources in this stage. Unmanaged resources are resources that are not handled by the .NET common language runtime such as file handles and database connections.
13. UnLoad
What do you mean by three-tier architecture?
The three-tier architecture was improve management of code and contents and to improve the performance of the web based applications. There are mainly three layers in three-tier architecture.This architecture remove the many drawbacks of previous Cliet-Server architecture.There are three stages in this Architecture;(1)Presentation Layer: PL(Presentation Layer) Contains only client side scripting like HTML, javascript and VB script etc.The input Validation validate on Cliet side.(2)Business Logic Layer:BL(Business Logic Layer) contain the server side code for data transaction, query and communicate through Data Base,and Pass the data to the user interface.(3)Database layer:Data Layer represents the data store like MS Access, SQL Server, an XML file, an Excel file or even a text file containing data also some additional database are also added to that layers.
The three-tier architecture was improve management of code and contents and to improve the performance of the web based applications. There are mainly three layers in three-tier architecture.This architecture remove the many drawbacks of previous Cliet-Server architecture.
There are three stages in this Architecture;
(1)Presentation Layer: PL(Presentation Layer) Contains only client side scripting like HTML, javascript and VB script etc.The input Validation validate on Cliet side.
(2)Business Logic Layer:BL(Business Logic Layer) contain the server side code for data transaction, query and communicate through Data Base,and Pass the data to the user interface.
(3)Database layer:Data Layer represents the data store like MS Access, SQL Server, an XML file, an Excel file or even a text file containing data also some additional database are also added to that layers.
Write the code that creates a cookie containing the user name R4R and the current date to the user computer. Set the cookie to remain on the user computer for 30 days?
Code:HttpCookie cookUserInfo = new HttpCookie(\"UserInfo\");CookUserInfo[\"Name\"] = \"R4R\";CookUserInfo[\"Time\"] = DateTime.Now.ToString();cookUserInfo.Expires = DateTime.Now.AddDays(30);Response.Cookies.Add(cookUserInfo);Description:\"HttpCookie\" :The HttpCookie class is under System.Web namespace.\"CookUserInfo\" :is the object of class HttpCookie\"Expires\": is the property that sets the duration,when cookie expire.
Code:
HttpCookie cookUserInfo = new HttpCookie(\"UserInfo\");CookUserInfo[\"Name\"] = \"R4R\";CookUserInfo[\"Time\"] = DateTime.Now.ToString();cookUserInfo.Expires = DateTime.Now.AddDays(30);Response.Cookies.Add(cookUserInfo);
HttpCookie cookUserInfo = new HttpCookie(\"UserInfo\");
CookUserInfo[\"Name\"] = \"R4R\";
CookUserInfo[\"Time\"] = DateTime.Now.ToString();
cookUserInfo.Expires = DateTime.Now.AddDays(30);
Response.Cookies.Add(cookUserInfo);
Description:
\"HttpCookie\" :The HttpCookie class is under System.Web namespace.
\"CookUserInfo\" :is the object of class HttpCookie
\"Expires\": is the property that sets the duration,when cookie expire.
Describe the property of cookie in Asp.Net ?
Properties:1. Domain: The domain associated with the cookie for example, aspx.superexpert.com2. Expires: The expiration date for a persistent cookie.3. HasKeys: A Boolean value that indicates whether the cookie is a cookie dictionary.4. Name: The name of the cookie.5. Path: The path associated with the Cookie. The default value is /.6. Secure: A value that indicates whether the cookie should be sent over an encrypted connection only. The default value is False.7. Value: The value of the Cookie.8. Values: A NameValueCollection that represents all the key and value pairs stored in a Cookie dictionary.
Properties:
1. Domain: The domain associated with the cookie for example, aspx.superexpert.com
2. Expires: The expiration date for a persistent cookie.
3. HasKeys: A Boolean value that indicates whether the cookie is a cookie dictionary.
4. Name: The name of the cookie.
5. Path: The path associated with the Cookie. The default value is /.
6. Secure: A value that indicates whether the cookie should be sent over an encrypted connection only. The default value is False.
7. Value: The value of the Cookie.
8. Values: A NameValueCollection that represents all the key and value pairs stored in a Cookie dictionary.
Differences between Web and Windows applications?
Web Forms:Web forms use server controls, HTML controls, user controls, or custom controls created specially for Web forms.Web applications are displayed in a browser.Web forms are instantiated on the server, sent to the browser, and destroyed immediately.Windows Forms:Windows forms are instantiated, exist for as long as needed, and are destroyed. Windows applications run on the same machine they are displayed on.Windows applications display their own windows and have more control over how those windows are displayed.
Web Forms:Web forms use server controls, HTML controls, user controls, or custom controls created specially for Web forms.Web applications are displayed in a browser.Web forms are instantiated on the server, sent to the browser, and destroyed immediately.
Windows Forms:Windows forms are instantiated, exist for as long as needed, and are destroyed. Windows applications run on the same machine they are displayed on.Windows applications display their own windows and have more control over how those windows are displayed.
What is the main difference between the Button server control and the Button HTML control?
The Button HTML control triggers the event procedure indicated in the buttons onclick attribute, which runs on the client.When clicked, the Button server control triggers an ASP.NET Click event procedure on the server.
The Button HTML control triggers the event procedure indicated in the buttons onclick attribute, which runs on the client.
When clicked, the Button server control triggers an ASP.NET Click event procedure on the server.
What is the difference between web.config and Machine.config files?
1. Usually on a webserver there is only one Machine.config file whereas in a web application there is no of files,but in the root directory.2. Web.config file settings will override machine.config settings.3. Machine.config file specifies configuration settings for all of the websites on the web server.Web.config file specify configuration settings for a particular web application, and is located in the applications root directory .
1. Usually on a webserver there is only one Machine.config file whereas in a web application there is no of files,but in the root directory.
2. Web.config file settings will override machine.config settings.
3. Machine.config file specifies configuration settings for all of the websites on the web server.Web.config file specify configuration settings for a particular web application, and is located in the applications root directory .
How do you require authentication using the Web.config file?
Include the following <authorization> element to require authentication:<authorization> <deny users=\"?\" /></authorization>
Include the following <authorization> element to require authentication:
<authorization> <deny users=\"?\" /></authorization>
<authorization>
<deny users=\"?\" />
</authorization>
Define Error Events in Asp.Net?
In ASP.Net when any unhandled exception accurs in application then an event occures,that event called Error event.Two types of Event:1. Page_Error:When exception occures in a page then this event raised.2. Application_error:Application_Error event raised when unhandled exceptions in the ASP.NET application and is implemented in global.asax.The error event have two method:1. GetLastError: Returns the last exception that occurred on the server.2. ClearError: This method clear error and thus stop the error to trigger subsequent error event.
In ASP.Net when any unhandled exception accurs in application then an event occures,that event called Error event.Two types of Event:
1. Page_Error:When exception occures in a page then this event raised.
2. Application_error:Application_Error event raised when unhandled exceptions in the ASP.NET application and is implemented in global.asax.
The error event have two method:
1. GetLastError: Returns the last exception that occurred on the server.
2. ClearError: This method clear error and thus stop the error to trigger subsequent error event.
Why the exception handling is important for an application?
Exception handling prevents the unusual error in the asp.net application,when apllication executed.If the exceptions are handled properly, the application will never get terminated abruptly.
Explain the aim of using EnableViewState property?
When the page is posted back to the server, the server control is recreated with the state stored in viewstate.It allows the page to save the users input on a form across postbacks. It saves all the server side values for a given control into ViewState, which is stored as a hidden value on the page before sending the page to the clients browser.
What are the two levels of variable supported by Asp.net?
1. Page level variable:String ,int ,float.2. Object level variable:Session level, Application level.
1. Page level variable:String ,int ,float.
2. Object level variable:Session level, Application level.
Difference between Session object and Profile object in ASP.NET?
Profile object:1. Profile object is persistent.2. Its uses the provider model to store information.3. Strongly typed4. Anonymous users used mostly.Session object:1. Session object is non-persistant.2. Session object uses the In Proc, Out Of Process or SQL Server Mode to store information.3. Not strongly typed.4. Only allowed for authenticated users.
Profile object:
1. Profile object is persistent.
2. Its uses the provider model to store information.
3. Strongly typed
4. Anonymous users used mostly.
Session object:
1. Session object is non-persistant.
2. Session object uses the In Proc, Out Of Process or SQL Server Mode to store information.
3. Not strongly typed.
4. Only allowed for authenticated users.
What is the Default Expiration Period For Session and Cookies,and maximum size of viewstate?
The default Expiration Period for Session is 20 minutes.The default Expiration Period for Cookie is 30 minutes.The maximum size of the viewstate is 25% of the page size
The default Expiration Period for Session is 20 minutes.
The default Expiration Period for Cookie is 30 minutes.
The maximum size of the viewstate is 25% of the page size
What is the use of Global.asax File in ASP.NET Application ?
The Global.asax file, can be stored in root directory and accesible for web-sites,is an optional file.This Global.asax file contained in HttpApplicationClass.we can declare global variables like variables used in master pages because these variables can be used for different pages right.Importent feature is that its provides more security in comparision to other.It handle two event:1.Application-level 2.Session-level events.Global.asax File itself configured but it can not be accessed.while one request is in processing it is impossible to send another request, we can not get response for other request and even we can not start a new session.while adding this Global.asax file to our application by default it contains five methods,Those methods are:1.Application_Start.2.Application_End.3.Session_Start.4.Session_End.5.Application_Error.
The Global.asax file, can be stored in root directory and accesible for web-sites,is an optional file.This Global.asax file contained in HttpApplicationClass.we can declare global variables like variables used in master pages because these variables can be used for different pages right.Importent feature is that its provides more security in comparision to other.
It handle two event:
1.Application-level
2.Session-level events.
Global.asax File itself configured but it can not be accessed.while one request is in processing it is impossible to send another request, we can not get response for other request and even we can not start a new session.
while adding this Global.asax file to our application by default it contains five methods,
Those methods are:
1.Application_Start.
2.Application_End.
3.Session_Start.
4.Session_End.
5.Application_Error.
What is the Purpose of System.Collections.Generic ?
For more safty and better performance strongly typed collections are useful for the user. System.Collections.Generic having interfaces and classes which define strongly typed generic collections.
What is GAC and name of the utility used to add an assembly into the GAC ?
GAC(Global Assembly Cache) for an effective sharing of assemblies.GAC refers to the machine-wide code cache in any of the computers that have been installed with common language runtime.Global Assembly Cache in .NET Framework acts as the central place for private registering assemblies.\"gacutil.exe\" utility used to add assembly in GAC
GAC(Global Assembly Cache) for an effective sharing of assemblies.GAC refers to the machine-wide code cache in any of the computers that have been installed with common language runtime.Global Assembly Cache in .NET Framework acts as the central place for private registering assemblies.
\"gacutil.exe\" utility used to add assembly in GAC
Whether we can use vbscript and javascript combination for validation?
WE cant use them togather,since compiler are different.
What are the different states in ASP.NET?
There are three types of state:1. View state: Under the client-side state managment.The ViewState property provides a dictionary object for retaining values between multiple requests for the same page. When an ASP.NET page is processed, the current state of the page and controls is hashed into a string and saved in the page as a hidden field. 2. Application state:Under the server side state managment. ASP.NET allows you to save values using application state, a global storage mechanism that is accessible from all pages in the Web application. Application state is stored in the Application key/value dictionary.3. Session state:Under server side state managment . ASP.NET allows you to save values using session state, a storage mechanism that is accessible from all pages requested by a single Web browser session.
There are three types of state:
1. View state: Under the client-side state managment.The ViewState property provides a dictionary object for retaining values between multiple requests for the same page. When an ASP.NET page is processed, the current state of the page and controls is hashed into a string and saved in the page as a hidden field.
2. Application state:Under the server side state managment. ASP.NET allows you to save values using application state, a global storage mechanism that is accessible from all pages in the Web application. Application state is stored in the Application key/value dictionary.
3. Session state:Under server side state managment . ASP.NET allows you to save values using session state, a storage mechanism that is accessible from all pages requested by a single Web browser session.
Define State managment?
This is passible to at a time many request occures.State management is the process by which maintained state and page information over multiple requests for the same or different pages.Two types of State Managment:1. Client side state managment:This stores information on the client\'s computer by embedding the information into a Web page,uniform resource locator(url), or a cookie.2. Server side state managment: There are two state Application State,Session State.
This is passible to at a time many request occures.State management is the process by which maintained state and page information over multiple requests for the same or different pages.
Two types of State Managment:
1. Client side state managment:This stores information on the client\'s computer by embedding the information into a Web page,uniform resource locator(url), or a cookie.
2. Server side state managment: There are two state Application State,Session State.
What is Authentication and Authorization ?
An authentication system is how you identify yourself to the computer. The goal behind an authentication system is to verify that the user is actually who they say they are.Once the system knows who the user is through authentication, authorization is how the system decides what the user can do.
An authentication system is how you identify yourself to the computer. The goal behind an authentication system is to verify that the user is actually who they say they are.
Once the system knows who the user is through authentication, authorization is how the system decides what the user can do.
Discribe Client Side State Management?
Client side state managment have:a. Stores information on the client\'s computer by embedding the information into a Web page.b. A uniform resource locator(url).c. Cookie.To store the state information at the client end terms are:1. View State:It is used by the Asp.net page framework to automatically save the values of the page and of each control just prior to rendering to the page.Asp.Net uses View State to track the values in the Controls. You can add custom values to the view state.2. Control State:When user create a custom control that requires view state to work properly, you should use control state to ensure other developers dont break your control by disabling view state.3. Hidden fields:Like view state, hidden fields store data in an HTML form without displaying it in the user\'s browser. The data is available only when the form is processed.4. Cookies: Cookies store a value in the user\'s browser that the browser sends with every page request to the same server. Cookies are the best way to store state data that must be available for multiple Web pages on a web site.5. Query Strings: Query strings store values in the URL that are visible to the user. Use query strings when you want a user to be able to e-mail or instant message state data with a URL.
Client side state managment have:
a. Stores information on the client\'s computer by embedding the information into a Web page.
b. A uniform resource locator(url).
c. Cookie.
To store the state information at the client end terms are:
1. View State:It is used by the Asp.net page framework to automatically save the values of the page and of each control just prior to rendering to the page.Asp.Net uses View State to track the values in the Controls. You can add custom values to the view state.
2. Control State:When user create a custom control that requires view state to work properly, you should use control state to ensure other developers dont break your control by disabling view state.
3. Hidden fields:Like view state, hidden fields store data in an HTML form without displaying it in the user\'s browser. The data is available only when the form is processed.
4. Cookies: Cookies store a value in the user\'s browser that the browser sends with every page request to the same server. Cookies are the best way to store state data that must be available for multiple Web pages on a web site.
5. Query Strings: Query strings store values in the URL that are visible to the user. Use query strings when you want a user to be able to e-mail or instant message state data with a URL.
Describe Server Side State Management ?
Sever side state managment provied Better security,Reduced bandwidth.1. Application State: This State information is available to all pages, regardless of which user requests a page.2. Session State Session State information is available to all pages opened by a user during a single visit.
Sever side state managment provied Better security,Reduced bandwidth.
1. Application State: This State information is available to all pages, regardless of which user requests a page.
2. Session State Session State information is available to all pages opened by a user during a single visit.
What is SessionID?
To identify the request from the browser used sessionID. SessionId value stored in a cookie. Configure the application to store SessionId in the URL for a \"cookieless\" session.
What is the Session Identifier?
Session Identifier is :1. To identify session. 2. It has SessionID property.3. When a page is requested, browser sends a cookie with a session identifier. 4. Session identifier is used by the web server to determine if it belongs to an existing session or not. If not, then Session ID is generated by the web server and sent along with the response.
Session Identifier is :
1. To identify session.
2. It has SessionID property.
3. When a page is requested, browser sends a cookie with a session identifier.
4. Session identifier is used by the web server to determine if it belongs to an existing session or not. If not, then Session ID is generated by the web server and sent along with the response.
Advantages of using Session State?
Advantages:1. It is easy to implement.2. Ensures platform scalability,works in the multi-process configuration.3. Ensures data durability, since session state retains data even if ASP.NET work process restarts as data in Session State is stored in other process space.
Advantages:
1. It is easy to implement.
2. Ensures platform scalability,works in the multi-process configuration.
3. Ensures data durability, since session state retains data even if ASP.NET work process restarts as data in Session State is stored in other process space.
Disadvantages of using Session State ?
Disadvatages:1. It is not advisable to use session state when working with large sum of data.Because Data in session state is stored in server memory.2. Too many variables in the memory effect performance. Because session state variable stays in memory until you destroy it.
Disadvatages:
1. It is not advisable to use session state when working with large sum of data.Because Data in session state is stored in server memory.
2. Too many variables in the memory effect performance. Because session state variable stays in memory until you destroy it.
What are the Session State Modes? Define each Session State mode supported by ASP.NET.
ASP.NET supports three Session State modes.1. InProc:This mode stores the session data in the ASP.NET worker process and fastest among all of the storage modes.Its Also effects performance if the amount of data to be stored is large.2. State Server:This mode maintained on a different system and session state is serialized and stored in memory in a separate process.State Server mode is serialization and de-serialization of objects. State Server mode is slower than InProc mode as this stores data in an external process.3. SQL Server:This mode can be used in the web farms and reliable and secures storage of a session state.In this storage mode, the Session data is serialized and stored in a database table in the SQL Server database.
ASP.NET supports three Session State modes.
1. InProc:This mode stores the session data in the ASP.NET worker process and fastest among all of the storage modes.Its Also effects performance if the amount of data to be stored is large.
2. State Server:This mode maintained on a different system and session state is serialized and stored in memory in a separate process.
State Server mode is serialization and de-serialization of objects. State Server mode is slower than InProc mode as this stores data in an external process.
3. SQL Server:This mode can be used in the web farms and reliable and secures storage of a session state.In this storage mode, the Session data is serialized and stored in a database table in the SQL Server database.
What is a Master Page in Asp.Net?
For consistent layout for the pages in application used Master Pages.A single master page defines the look and feel and standard behavior that you want for all of the pages (or a group of pages) in your application.Then user create individual content pages that share all the information and lay out of a Master Page.
What are the 2 important parts of a master page and file extension for a Master Page?
The following are the 2 important parts of a master page1. The Master Page itself2. One or more Content PagesThe file extention for Master Page is \".master\".
The following are the 2 important parts of a master page
1. The Master Page itself
2. One or more Content Pages
The file extention for Master Page is \".master\".
How do you identify a Master Page and how do you bind a Content Page to a Master Page?
The master page is identified by a special @ Master directive that replaces the @ Page directive that is used for ordinary .aspx pages.MasterPageFile attribute of a content page\'s @ Page directive is used to bind a Content Page to a Master Page.
The master page is identified by a special @ Master directive that replaces the @ Page directive that is used for ordinary .aspx pages.
MasterPageFile attribute of a content page\'s @ Page directive is used to bind a Content Page to a Master Page.
Can you dynaimically assign a Master Page?
void Page_PreInit(Object sender, EventArgs e) { if (Request.Browser.IsBrowser(\"IE\")) { this.MasterPageFile = \"ArticleMaster_IE.master\"; } else if (Request.Browser.IsBrowser(\"Mozilla\")) { this.MasterPageFile = \"ArticleMaster_FireFox.master\"; } else { this.MasterPageFile = \"ArticleMaster.master\"; } }
void Page_PreInit(Object sender, EventArgs e) {
if (Request.Browser.IsBrowser(\"IE\")) {
this.MasterPageFile = \"ArticleMaster_IE.master\";
else if (Request.Browser.IsBrowser(\"Mozilla\")) {
this.MasterPageFile = \"ArticleMaster_FireFox.master\";
else {
this.MasterPageFile = \"ArticleMaster.master\";
From the content page code how can you reference a control on the master page?
Use the FindControl() method as shown in the code sample below.void Page_Load(){// Gets a reference to a TextBox control inside// a ContentPlaceHolderContentPlaceHolder ContPlaceHldr = (ContentPlaceHolder)Master.FindControl (\"ContentPlaceHolder1\");if(ContPlaceHldr != null){TextBox TxtBox = (TextBox)ContPlaceHldr.FindControl(\"TextBox1\");if(TxtBox != null){TxtBox.Text = \"WHERE R4R\";}}// Gets a reference to a Label control that not in// a ContentPlaceHolderLabel Lbl = (Label)Master.FindControl(\"Label1\");if(Lbl != null){Lbl.Text = \"R4R HERE\";}}
Use the FindControl() method as shown in the code sample below.
void Page_Load(){// Gets a reference to a TextBox control inside// a ContentPlaceHolderContentPlaceHolder ContPlaceHldr = (ContentPlaceHolder)Master.FindControl (\"ContentPlaceHolder1\");if(ContPlaceHldr != null){TextBox TxtBox = (TextBox)ContPlaceHldr.FindControl(\"TextBox1\");if(TxtBox != null){TxtBox.Text = \"WHERE R4R\";}}// Gets a reference to a Label control that not in// a ContentPlaceHolderLabel Lbl = (Label)Master.FindControl(\"Label1\");if(Lbl != null){Lbl.Text = \"R4R HERE\";}}
void Page_Load()
// Gets a reference to a TextBox control inside
// a ContentPlaceHolder
ContentPlaceHolder ContPlaceHldr = (ContentPlaceHolder)Master.FindControl (\"ContentPlaceHolder1\");
if(ContPlaceHldr != null)
TextBox TxtBox = (TextBox)ContPlaceHldr.FindControl(\"TextBox1\");
if(TxtBox != null)
TxtBox.Text = \"WHERE R4R\";
// Gets a reference to a Label control that not in
Label Lbl = (Label)Master.FindControl(\"Label1\");
if(Lbl != null)
Lbl.Text = \"R4R HERE\";
What is Globalization?
Globalization is the process of creating an application that meets the needs of users from multiple cultures.This process involves translating the user interface elements of an application into multiple languages, using the correct currency, date and time format, calendar, writing direction, sorting rules, and other issues.
Globalization is the process of creating an application that meets the needs of users from multiple cultures.
This process involves translating the user interface elements of an application into multiple languages, using the correct currency, date and time format, calendar, writing direction, sorting rules, and other issues.
What are the 3 different ways to globalize web applications?
Detect and redirect approach : In this approach we create a separate Web application for each supported culture, and then detect the users culture and redirect the request to the appropriate application. This approach is best for applications with lots of text content that requires translation and few executable components.Run-time adjustment approach : In this approach we create a single Web application that detects the users culture and adjusts output at run time using format specifiers and other tools. This approach is best for simple applications that present limited amounts of content.Satellite assemblies approach : In this approach we create a single Web application that stores culture-dependent strings in resource files that are compiled into satellite assemblies. At run time, detect the users culture and load strings from the appropriate assembly. This approach is best for applications that generate content at run time or that have large executable components.
Detect and redirect approach : In this approach we create a separate Web application for each supported culture, and then detect the users culture and redirect the request to the appropriate application. This approach is best for applications with lots of text content that requires translation and few executable components.
Run-time adjustment approach : In this approach we create a single Web application that detects the users culture and adjusts output at run time using format specifiers and other tools. This approach is best for simple applications that present limited amounts of content.
Satellite assemblies approach : In this approach we create a single Web application that stores culture-dependent strings in resource files that are compiled into satellite assemblies. At run time, detect the users culture and load strings from the appropriate assembly. This approach is best for applications that generate content at run time or that have large executable components.
What are the steps to follow to get user\'s culture at run time?
1. Get the Request objects UserLanguages property.2. Use the returned value with the CultureInfo class to create an object representing the users current culture.For example, the following code gets the users culture and displays the English name and the abbreviated name of the culture in a label the first time the page is displayed:private void Page_Load(object sender, System.EventArgs e){// Run the first time the page is displayedif (!IsPostBack){// Get the user\'s preferred language.string sLang = Request.UserLanguages[0];// Create a CultureInfo object from it.CultureInfo CurrentCulture = new CultureInfo(sLang);lblCulture.Text = CurrentCulture.EnglishName + \": \" +CurrentCulture.Name;}}
1. Get the Request objects UserLanguages property.
2. Use the returned value with the CultureInfo class to create an object representing the users current culture.
For example, the following code gets the users culture and displays the English name and the abbreviated name of the culture in a label the first time the page is displayed:
private void Page_Load(object sender, System.EventArgs e)
// Run the first time the page is displayed
if (!IsPostBack)
// Get the user\'s preferred language.
string sLang = Request.UserLanguages[0];
// Create a CultureInfo object from it.
CultureInfo CurrentCulture = new CultureInfo(sLang);
lblCulture.Text = CurrentCulture.EnglishName + \": \" +
CurrentCulture.Name;
What do you mean by neutral cultures?
Neutral cultures represent general languages, such as English or Spanish and a specific language and region.ASP.NET assigns that culture to all the threads running for that Web application.When user set culture attribute for a Web application in Web.config.ASP.NET maintains multiple threads for a Web application within the aspnet_wp.exe worker process.
What is the advantage of using Windows authentication in a Web application?
The advantage of Windows authentication:1. Web application can use the exact same security that applies to your corporate network like user names, passwords, and permissions.2. To access the Web application users logged on to the network. It is importent that user does\'nt logged on again.
The advantage of Windows authentication:
1. Web application can use the exact same security that applies to your corporate network like user names, passwords, and permissions.
2. To access the Web application users logged on to the network. It is importent that user does\'nt logged on again.
What is the default authentication method when you create a new Web application project?
Windows authentication is the default authentication method when you create a new Web application project.
How do you get a User Identity?
Using the User objects Identity property. The Identity property returns an object that includes the user name and role information, as shown in the following code:private void Page_Load(object sender, System.EventArgs e){Label1.Text = User.Identity.IsAuthenticated.ToString();Label2.Text = User.Identity.Name;Label3.Text = User.Identity.AuthenticationType;}
Using the User objects Identity property. The Identity property returns an object that includes the user name and role information, as shown in the following code:
private void Page_Load(object sender, System.EventArgs e){Label1.Text = User.Identity.IsAuthenticated.ToString();Label2.Text = User.Identity.Name;Label3.Text = User.Identity.AuthenticationType;}
Label1.Text = User.Identity.IsAuthenticated.ToString();
Label2.Text = User.Identity.Name;
Label3.Text = User.Identity.AuthenticationType;
How do you determine, what is the role of the current user?
The User object provides an IsInRole method to determine the role of the current user, as shown in the following example:if(User.IsInRole(\"Administrators\")){///////}
The User object provides an IsInRole method to determine the role of the current user, as shown in the following example:
if(User.IsInRole(\"Administrators\")){///////}
if(User.IsInRole(\"Administrators\"))
///////
Can you specify authorization settings both in Web.config and in IIS?
Yes,It wil be done. For this, the IIS setting is evaluated first and then the setting in Web.config is evaluated. Hence we can say,the most restrictive setting will be used.
What are the 2 Layouts supported by a Web form in ASP.NET?
1. Grid layout: Pages using grid layout will not always display correctly in non-Microsoft browsers,and controls are placed exactly where they draw.It means they have absolute positions on the page. Use grid layout for Microsoft Windows style applications, in which controls are not mixed with large amounts of text.2. Flow layout: Controls relative to other elements on the page.Controls that appear after the new element move down if you add elements at run time.Flow layout for document-style applications, in which text and controls are intermingled.
1. Grid layout: Pages using grid layout will not always display correctly in non-Microsoft browsers,and controls are placed exactly where they draw.It means they have absolute positions on the page. Use grid layout for Microsoft Windows style applications, in which controls are not mixed with large amounts of text.
2. Flow layout: Controls relative to other elements on the page.
Controls that appear after the new element move down if you add elements at run time.
Flow layout for document-style applications, in which text and controls are intermingled.
What is the difference between Literal and Lable Control?
We use literals control if we want to typed text using HTML formating and without using property.We typed HTML code in .cs file when used literals.Lable control when displayed already formated.Typed text can not be formated in .cs file.
We use literals control if we want to typed text using HTML formating and without using property.We typed HTML code in .cs file when used literals.
Lable control when displayed already formated.Typed text can not be formated in .cs file.
What is smart navigation?
Smart navigation is, cursor position is maintained when the page gets refreshed due to the server side validation and the page gets refreshed.
1. Server.Transfer() performs server side redirection of the page avoiding extra round trip. While The Response. Redirect() method can be used to redirect the browser to specified url.2. Server.Transfer is used to post a form to another page. Response.Redirect is used to redirect the user to another page or site.
1. Server.Transfer() performs server side redirection of the page avoiding extra round trip. While The Response. Redirect() method can be used to redirect the browser to specified url.
2. Server.Transfer is used to post a form to another page. Response.Redirect is used to redirect the user to another page or site.
Can you explain the difference between an ADO.NET Dataset and an ADO Recordset?
1. A DataSet can represent an entire relational database in memory, complete with tables, relations, and views. 2. A DataSet is designed to work without any continuing connection to the original data source. 3. Data in a DataSet is bulk-loaded, rather than being loaded on demand.
1. A DataSet can represent an entire relational database in memory, complete with tables, relations, and views.
2. A DataSet is designed to work without any continuing connection to the original data source.
3. Data in a DataSet is bulk-loaded, rather than being loaded on demand.
Can you give an example of when you might use it?
When you want to inherit (use the functionality of) another class. Base Class Employee. A Manager class could be derived from the Employee base class.
Can the action attribute of a server-side tag be set to a value and if not how can you possibly pass data from a form page to a subsequent page.
What is the role of global.asax.
Store global information about the application
Whats a bubbled event?
When you have a complex control, like DataGrid, writing an event processing routine for each object (cell, button, row, etc.) is quite tedious. The controls can bubble up their eventhandlers, allowing the main DataGrid event handler to take care of its constituents.
Describe the difference between inline and code behind.
Inline code written along side the html in a page. Code-behind is code written in a separate file and referenced by the .aspx page.
Which method do you invoke on the DataAdapter control to load your generated dataset with data?
The .Fill() method
Can you edit data in the Repeater control?
No, it just reads the information from its data source
Which template must you provide, in order to display data in a Repeater control?
ItemTemplate
How can you provide an alternating color scheme in a Repeater control?
Use the AlternatingItemTemplate
What property must you set, and what method must you call in your code, in order to bind the data from some data source to the Repeater control?
You must set the DataSource property and call the DataBind method.
Name two properties common in every validation control?
ControlToValidate property and Text property
Where does the Web page belong in the .NET Framework class hierarchy?
System.Web.UI.Page
Where do you store the information about the user�s locale?
System.Web.UI.Page.Culture
Can you give an example of what might be best suited to place in the Application Start and Session Start subroutines?
This is where you can set the specific variables for the Application and Session objects.
What is the transport protocol you use to call a Web service?
SOAP is the preferred protocol.
To test a Web service you must create a windows application or Web application to consume this service?
The webservice comes with a test page and it provides HTTP-GET method to test.
Whats the difference between struct and class in C#?
1. Structs cannot be inherited. 2. Structs are passed by value, not by reference. 3. Struct is stored on the stack, not the heap.
1. Structs cannot be inherited.
2. Structs are passed by value, not by reference.
3. Struct is stored on the stack, not the heap.
Where do the reference-type variables go in the RAM?
The references go on the stack, while the objects themselves go on the heap. However, in reality things are more elaborate.
What is the difference between the value-type variables and reference-type variables in terms of garbage collection?
The value-type variables are not garbage-collected, they just fall off the stack when they fall out of scope, the reference-type objects are picked up by GC when their references go null.
What is main difference between Global.asax and Web.Config?
aASP.NET uses the global.asax to establish any global objects that your Web application uses. The .asax extension denotes an application file rather than .aspx for a page file. Each ASP.NET application can contain at most one global.asax file. The file is compiled on the first page hit to your Web application. ASP.NET is also configured so that any attempts to browse to the global.asax page directly are rejected. However, you can specify application-wide settings in the web.config file. The web.config is an XML-formatted text file that resides in the Web sites root directory. Through Web.config you can specify settings like custom 404 error pages, authentication and authorization settings for the Web site, compilation options for the ASP.NET Web pages, if tracing should be enabled, etc
What is SOAP and how does it relate to XML?
The Simple Object Access Protocol (SOAP) uses XML to define a protocol for the exchange of information in distributed computing environments. SOAP consists of three components: an envelope, a set of encoding rules, and a convention for representing remote procedure calls. Unless experience with SOAP is a direct requirement for the open position, knowing the specifics of the protocol, or how it can be used in conjunction with HTTP, is not as important as identifying it as a natural application of XML.
Using XSLT, how would you extract a specific attribute from an element in an XML document?
Successful candidates should recognize this as one of the most basic applications of XSLT. If they are not able to construct a reply similar to the example below, they should at least be able to identify the components necessary for this operation: xsl:template to match the appropriate XML element, xsl:value-of to select the attribute value, and the optional xsl:apply-templates to continue processing the document.
Whats a Windows process?
Its an application thats running and had been allocated memory.
What is typical about a Windows process in regards to memory allocation?
Each process is allocated its own block of available RAM space, no process can access another process code or data. If the process crashes, it dies alone without taking the entire OS or a bunch of other applications down.
Explain what relationship is between a Process, Application Domain, and Application?
A process is an instance of a running application. An application is an executable on the hard drive or network. There can be numerous processes launched of the same application (5 copies of Word running), but 1 process can run just 1 application.
Define the possible implementations of distributed applications in .NET?
.NET Remoting and ASP.NET Web Services. If we talk about the Framework Class Library, noteworthy classes are in System.Runtime.Remoting and System.Web.Services.
Give your idea when deciding to use .NET Remoting or ASP.NET Web Services?
1. Remoting is a more efficient communication exchange when you can control both ends of the application involved in the communication process. 2. Web Services provide an open-protocol-based exchange of informaion. Web Services are best when you need to communicate with an external organization or another (non-.NET) technology.
Do you know the proxy of the server object in .NET Remoting?
This process is known as marshaling. It handles the communication between real server object and the client object. We can say that It is a fake copy of the server object that resides on the client side and behaves as if it was the server.
What are remotable objects in .NET Remoting?
1. They can be marshaled across the application domains.2. You can marshal by value, where a deep copy of the object is created and then passed to the receiver. You can also marshal by reference, where just a reference to an existing object is passed.
1. They can be marshaled across the application domains.
2. You can marshal by value, where a deep copy of the object is created and then passed to the receiver. You can also marshal by reference, where just a reference to an existing object is passed.
In .NET Remoting, What are channels?
Channels represent the objects that transfer the other serialized objects from one application domain to another and from one computer to another, as well as one process to another on the same box. A channel must exist before an object can be transferred.
What security measures exist for .NET Remoting?
None.
What is Singleton activation mode?
A single object is instantiated regardless of the number of clients accessing it. Lifetime of this object is determined by lifetime lease.
How to configure a .NET Remoting object via XML file?
It can be done via machine.config and application level .config file (or web.config in ASP.NET). Application-level XML settings take precedence over machine.config.
How can you automatically generate interface for the remotable object in .NET?
Use the Soapsuds tool.
What is the top .NET class that everything is derived from?
System.Object.
Difference between System.String and System.Text.StringBuilder classes?
System.String is immutable. System.StringBuilder was designed with the purpose of having a mutable string where a variety of operations can be performed.
Difference between the System.Array.Clone() and System.Array.CopyTo()?
The Clone() method returns a new array (a shallow copy) object containing all the elements in the original array. The CopyTo() method copies the elements into another existing array. Both perform a shallow copy. A shallow copy means the contents (each array element) contains references to the same object as the elements in the original array. A deep copy (which neither of these methods performs) would create a new instance of each element\'s object, resulting in a different, yet identacle object.
What is the .NET collection class that allows an element to be accessed using a unique key?
HashTable.
What class is underneath the SortedList class?
A sorted HashTable.
How to prevent your class from being inherited by another class?
We use the sealed keyword to prevent the class from being inherited.
How to allowed a class to be inherited, but it must be prevent the method from being over-ridden?
Just leave the class public and make the method sealed.
Define abstract class?
1. A class that cannot be instantiated.2. An abstract class is a class that must be inherited and have the methods overridden.3. An abstract class is essentially a blueprint for a class without any implementation
1. A class that cannot be instantiated.
2. An abstract class is a class that must be inherited and have the methods overridden.
3. An abstract class is essentially a blueprint for a class without any implementation
When you declared a class as abstract?
1. When at least one of the methods in the class is abstract. 2. When the class itself is inherited from an abstract class, but not all base abstract methods have been overridden.
1. When at least one of the methods in the class is abstract.
2. When the class itself is inherited from an abstract class, but not all base abstract methods have been overridden.
Define interface class ?
Interfaces, like classes, define a set of properties, methods, and events. But unlike classes, interfaces do not provide implementation. They are implemented by classes, and defined as separate entities from classes.
How to Specify the accessibility modifier for methods inside the interface?
They all must be public, and are therefore public by default.
What is the difference between an interface and abstract class ?
1. In an interface class, all methods are abstract and there is no implementation. In an abstract class some methods can be concrete.2. In an interface class, no accessibility modifiers are allowed. An abstract class may have accessibility modifiers.
1. In an interface class, all methods are abstract and there is no implementation. In an abstract class some methods can be concrete.
2. In an interface class, no accessibility modifiers are allowed. An abstract class may have accessibility modifiers.
Tell me implicit name of the parameter that gets passed into the set property of a class?
The data type of the value parameter is defined by whatever data type the property is declared as.
What does the keyword virtual declare for a method?
The method or property can be overridden.
How to create voting poll system in asp.net which allows user to see the results?
Difference bt ASP and asp.net?
1.Asp .net is compiled while asp is interpreted. 2.ASP is mostly written using VB Script and HTML. while asp .net can be written in C#, J# and VB etc. 3.Asp .net have 4 built in classes session , application , request response, while asp .net have more than 2000 built in classes. 4.ASP does not have any server side components whereas Asp .net have server side components such as Button , Text Box etc. 5.Asp does not have page level transaction while Asp .net have page level transaction. ASP .NET pages only support one language on a single page, while Asp support multiple language on a single page. 6.Page functions must be declared as Set Cookie Values
Explain the difference between a database administrator and a data administrator.
C tutorial
C++ tutorial
Corejava
Advanced java
C# tutorial
HTML
CSS tutorial
ASP.net
WCF tutorial
WPF tutorial
Struts tutorial
Spring
Hibernate
Android
Unix tutorial
Linux tutorial
SQL tutorial
WEB technology
Database & SQL
HR FAQs
Interview & FAQs
ASK Questions
PHP
Testing
Tutorials
Articles
Source Code
e-Books
Certifications
FAQS