What is default skin and named skin in ASP.Net

In ASP.Net Web Form default skin applied to all of the Web server controls that are of similar type.It doesnot have any SkinID.

Named skin had the Skin ID and we need to set the Skin ID property of the control to use this.

How we can sign out from form authentication in ASP.Net

Signout() method of FormsAuthentication class is being used for signing out from the form authentication.

What is CompareValidator in ASP.Net and How we will use it

CompareValidator is a validator in ASP.Net that can be used for comparing values in two controls.

Below is the way to use the CompareValidator in ASP.Net-

<asp:TextBox ID="txtAmount" runat="server"></asp:TextBox>
<asp:TextBox ID="txtConfirmAmount" runat="server"></asp:TextBox>

<asp:CompareValidator ID="cmpValidator" Operator="Equal" ControlToCompare="txtAmount" ControlToValidate="txtConfirmAmount" runat="server"></asp:CompareValidator>

Operator allows following 7 ways to compare the values in controls-


What is the base class of web server controls in ASP.Net

System.Web.UI.Control class is the parent class of the ASP.Net server controls.

What is the base class of web pages in ASP.Net

System.Web.UI.Page class is the parent class of the ASP.Net pages.

What is the scope of the ViewState

The scope of the ViewState is on Page level. We can access the ViewState until that page get expired.

We can get/set value in ViewState in following ways-

//Set the value in ViewState

ViewState["Name"] = "Manish";

//Get the value from the ViewState

string name = ViewState["Name"];

In which event of the ASP.Net Page life cycle the controls are full loaded

In Page_Load event of the ASP.Net the controls are fully loaded. We can access the controls in Page_Init event also but in this event view state is still not get loaded.