Home Microsoft Technology ASP .NET Interview Questions ASP .NET Interview Questions - 3

Login Form




ASP .NET Interview Questions - 3 Print E-mail

1. Can you explain what inheritance is and an example of when you might use it?

When you want to inherit (use the functionality of) another class. Example: With a base class named Employee, a Manager class could be derived from the Employee base class.

 

2. When during the page processing cycle is ViewState available?

After the Init() and before the Page_Load(), or OnLoad() for a control.

 

3. Where do you store the information about the user's locale?

System.Web.UI.Page.Culture

 

4. What base class do all Web Forms inherit from?

The Page class.

 

5. What data types do the RangeValidator control support?

Integer, String, and Date

 

6. Should user input data validation occur server-side or client-side?  Why?

All user input data validation should occur on the server at a minimum.  Additionally, client-side validation can be performed where deemed appropriate and feasable to provide a richer, more responsive experience for the user.

 

7. What is the lifespan for items stored in ViewState?

Item stored in ViewState exist for the life of the current page.  This includes postbacks (to the same page).

 

8. How can you provide an alternating color scheme in a Repeater control?

Use the AlternatingItemTemplate.

 

9. Suppose you want a certain ASP.NET function executed on MouseOver for a certain button.  Where do you add an event handler?

Add an OnMouseOver attribute to the button.  Example: btnSubmit.Attributes.Add("onmouseover","someClientCodeHere();");

 

10. Can you explain the difference between an ADO.NET Dataset and an ADO Recordset?

Valid answers are:

  •   A DataSet can represent an entire relational database in memory, complete with tables, relations, and views.
  •   A DataSet is designed to work without any continuing connection to the original data source.
  •   Data in a DataSet is bulk-loaded, rather than being loaded on demand.
  •   There's no concept of cursor types in a DataSet.
  •   DataSets have no current record pointer You can use For Each loops to move through the data.
  •   You can store many edits in a DataSet, and write them to the original data source in a single operation.
  •   Though the DataSet is universal, other objects in ADO.NET come in different versions for different data sources.

 

11. What is the difference between Value Types and Reference Types?

Value Types uses Stack to store the data where as the later uses the Heap to store the data.

 

12. What is view state and use of it?

The current property settings of an ASP.NET page and those of any ASP.NET server controls contained within the page. ASP.NET can detect when a form is requested for the first time versus when the form is posted (sent to the server), which  allows you to program accordingly.

 

13. Which property on a Combo Box do you set with a column name, prior to setting the DataSource, to display data in the combo box?

DataTextField property.

 

14. Explain the differences between Server-side and Client-side code?

Server-side code executes on the server.  Client-side code executes in the client's browser.

 

15. What type of code (server or client) is found in a Code-Behind class?

The answer is server-side code since code-behind is executed on the server.  However, during the code-behind's execution on the server, it can render client-side code such as JavaScript to be processed in the clients browser.  But just to be clear, code-behind executes on the server, thus making it server-side code.