Search Placementyogi.com
 

Asp.Net Interview Questions and Answers

  :: Topics ::

1.

What is "AutoPostBack"?

A: 

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.

2.

How can we ensure that the page is Post Back?

A: 

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

3.

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

A: 

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

4.

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

A: 

Page specific attributes are set using @Page directive.

5.

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

A: 

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.

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

//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
6.

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

A: 

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.

7.

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

A: 

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.

8.

Can a DropDownList be validated using RequiredFieldValidator?

A: 

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

 

Banner to LogicGuns.com

Hide Page Information
Asp.Net Interview Questions and Answers