Asp.Net Interview Questions and Answers

  :: Topics ::


What is "AutoPostBack"?


If any control needs automatic post back in case of any events then attribute "AutoPostBack" of that control must be set to true. For example on a button click if you want the event to go serer side immediately then set "AutoPostBack" attribute of this button to true.


How can we ensure that the page is Post Back?


By using the property "IsPostBack" of page event, it can be ensured that a page is post back or not.


What is the role of @Resister directives in ASP.NET?


@Resister directive informs the compiler about the custom server control added to the page.


How can page specific attributes be set in ASP.NET?


Page specific attributes are set using @Page directive.


What is connectionStrings section in Web.config file in ASP.NET?


Web.config file is the most important file of any web project where project configuration can be defined. The connectionStrings section is used to configure the database connection for this project.

		<add name="ConnectionStringName" connectionString="Server=server_name; 
		Port=xxxx; Database=database_name;   Uid=user_id; Pwd=password" />

//ConnectionStringName : Any name for this connection
//server_name : Name of the host server or IP address
//xxxx : Port number for the used database
//database_name : Name of the database created for this project
//user_id : user id to connect to this database
//password : Password to connect to this database

What is the order of events execution in APS.NET?


ASP.NET events occur in the following order:

  1. Page_Init
  2. Page_Load
  3. Control Events
  4. Page Unload Events

Page_Init event occurs only once when the page is loaded for the first time.


What is the significance of Global.asax file in ASP.NET project?


The Global.asax file also known as ASP.NET application file is used to respond application level events such as application starting and ending events, session starting and ending events, application error etc.It is not compulsory to define this file in your project as it is optional.


Can a DropDownList be validated using RequiredFieldValidator?


Yes, this can be done by setting the IntialProperty of RequiredFieldValidator control.


Banner to

Hide Page Information
Asp.Net Interview Questions and Answers