ASP NET Interview Questions
ASP NET Interview Questions
This is a list of questions I have gathered and created over a period of time from my
experience, many of which I felt where incomplete or simply wrong. I have finally taken
the time to go through each question and correct them to the best of my ability. However,
please feel free to post feedback to challenge, improve, or suggest new questions. I want
to thank those of you that have contributed quality questions and corrections thus far.
There are some questions in this list that I do not consider to be good questions for an
interview. However, they do exist on other lists available on the Internet so I felt
compelled to keep them here for easy access.
5. What namespace does the Web page belong in the .NET Framework class
hierarchy?
System.Web.UI.Page
13. 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.
15. 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.
17. What are the Application_Start and Session_Start subroutines used for?
This is where you can set the specific variables for the Application and Session
objects.
18. 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.
23. Which method do you invoke on the DataAdapter control to load your
generated dataset with data?
The Fill() method.
25. Which template must you provide, in order to display data in a Repeater
control?
ItemTemplate.
26. How can you provide an alternating color scheme in a Repeater control?
Use the AlternatingItemTemplate.
27. What property must you set, and what method must you call in your code,
in order to bind the data from a data source to the Repeater control?
You must set the DataSource property and call the DataBind method.
30. 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.
31. Which control would you use if you needed to make sure the values in two
different controls matched?
CompareValidator control.
1. What is ViewState?
ViewState allows the state of objects (serializable) to be stored in a hidden field on
the page. ViewState is transported to the client and back to the server, and is not
stored on the server or any other external source. ViewState is used the retain the
state of server-side objects between postabacks.