ASP.Net Interview Questions & Answers

  • Home
  • Interview_Question

Interview Questions & Answers

Select Series

What is ASP.Net?

It is a framework developed by Microsoft on which we can develop new generation web sites using web forms(aspx), MVC, HTML, Javascript, CSS etc. Its successor of Microsoft Active Server Pages(ASP). Currently there is ASP.NET 4.0, which is used to develop web sites. There are various page extensions provided by Microsoft that are being used for web site development. Eg: aspx, asmx, ascx, ashx, cs, vb, html, XML etc.

In which event of page cycle is the ViewState available?

After the Init() and before the Page_Load().

What are the different validators in ASP.NET?

There are six types of validator in ASP.NET: 1-Required field Validator 2-Range Validator 3-Compare Validator 4-Custom Validator 5-Regular expression Validator 6-Summary Validator

Which validator control you use if you need to make sure the values in two different controls matched?

Compare Validator control

How long the items in ViewState exists?

They exist for the life of the current page.

What are the different types of caching?

ASP.NET has 3 kinds of caching : 1-Output Caching 2-Fragment Caching 3-Data Caching

List the events in page life cycle?

1-Page_PreInit 2- Page_Init 3- Page_InitComplete 4- Page_PreLoad 5- Page_Load 6- Page_LoadComplete 7- Page_PreRender 8-Render

Can we add code files of different languages in App_Code folder?

No. The code files must be in same language to be kept in App_code folder.

What is Protected Configuration?

It is a feature used to secure connection string information.

What is the good practice to implement validations in aspx page?

Client-side validation is the best way to validate data of a web page. It reduces the network traffic and saves server resources.

Can we have multiple web config files for an application?


What is the difference between web config and machine config?

Web config file is specific to a web application where as machine config is specific to a machine or server. There can be multiple web config files into an application where as we can have only one machine config file on a server.

What is RedirectPermanent in ASP.Net?

Redirect Permanent Performs a permanent redirection from the requested URL to the specified URL. Once the redirection is done, it also returns 301 Moved Permanently responses.

List all templates of the Repeater control?

1-ItemTemplate 2-AlternatingltemTemplate 3-SeparatorTemplate 4-HeaderTemplate 5-FooterTemplate

What is the difference between an HtmlInputCheckBox control and an HtmlInputRadioButton control?

In HtmlInputCheckBoxcontrol, multiple item selection is possible whereas in HtmlInputRadioButton controls, we can select only single item from the group of items.

Which namespaces are necessary to create a localized application?

1-System.Globalization 2-System.Resources

What are the different types of cookies in ASP.NET?

1-Session Cookie – Resides on the client machine for a single session until the user does not log out. 2-Persistent Cookie – Resides on a user’s machine for a period specified for its expiry, such as 10 days, one month, and never.

What is the file extension of web service?

Web services have file extension .asmx.

How can we add icons to the web page?

We can add icons to the HTML webpage by using an icon library like font-awesome. We have to add the name of the given icon class to any inline HTML element. ( or ) . Icons in the icon libraries are scalable vectors that can be customized with CSS.