Interview Questions

Select Topic 

Interview Questions

Ques:1  What is ASP.Net?
Ans:  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.

Ques:2  In which event of page cycle is the ViewState available?
Ans:  After the Init() and before the Page_Load().

Ques:3  From which base class all Web Forms are inherited?
Ans:  Page class

Ques:4  What are the different validators in ASP.NET?
Ans:  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

Ques:5  Which validator control you use if you need to make sure the values in two different controls matched?
Ans:  Compare Validator control

Ques:6  What is ViewState?
Ans:  ViewState is used to retain the state of server-side objects between page post backs.

Ques:7  How long the items in ViewState exists?
Ans:  They exist for the life of the current page.

Ques:8  What is caching?
Ans:  Caching is a technique used to increase performance by keeping frequently accessed data or files in memory. The request for a cached file/data will be accessed from cache instead of actual location of that file.

Ques:9  What are the different types of caching?
Ans:  ASP.NET has 3 kinds of caching : 1-Output Caching 2-Fragment Caching 3-Data Caching

Ques:10  List the events in page life cycle?
Ans:  1-Page_PreInit 2- Page_Init 3- Page_InitComplete 4- Page_PreLoad 5- Page_Load 6- Page_LoadComplete 7- Page_PreRender 8-Render

Ques:11  Can we add code files of different languages in App_Code folder?
Ans:  No. The code files must be in same language to be kept in App_code folder.

Ques:12  What is Protected Configuration?
Ans:  It is a feature used to secure connection string information.

Ques:13  What is the good practice to implement validations in aspx page?
Ans:  Client-side validation is the best way to validate data of a web page. It reduces the network traffic and saves server resources.

Ques:14  Which protocol is used to call a Web service?
Ans:  HTTP Protocol

Ques:15  Can we have multiple web config files for an application?
Ans:  Yes

Ques:16  What is the difference between web config and machine config?
Ans:  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.

Ques:17  What is RedirectPermanent in ASP.Net?
Ans:  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.

Ques:18  List all templates of the Repeater control?
Ans:  1-ItemTemplate 2-AlternatingltemTemplate 3-SeparatorTemplate 4-HeaderTemplate 5-FooterTemplate

Ques:19  List the major built-in objects in ASP.NET?
Ans:  1-Application 2-Request 3-Response 4-Server 5-Session 6-Context 7-Trace

Ques:20  Which data type does the Range Validator control support?
Ans:  The data types supported by the Range Validator control are Integer, Double, String, Currency, and Date.

Ques:21  What is the difference between an HtmlInputCheckBox control and an HtmlInputRadioButton control?
Ans:  In HtmlInputCheckBoxcontrol, multiple item selection is possible whereas in HtmlInputRadioButton controls, we can select only single item from the group of items.

Ques:22  Which namespaces are necessary to create a localized application?
Ans:  1-System.Globalization 2-System.Resources

Ques:23  What are the different types of cookies in ASP.NET?
Ans:  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.

Ques:24  What is the file extension of web service?
Ans:  Web services have file extension .asmx.

Ques:25  What is the difference between ExecuteScalar and ExecuteNonQuery?
Ans:  ExecuteScalar returns output value where as ExecuteNonQuery does not return any value but the number of rows affected by the query. ExecuteScalar used for fetching a single value and ExecuteNonQuery used to execute Insert and Update statements.

Ques:26  How can we add icons to the web page?
Ans:  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.