26. How can you provide an alternating color scheme
in a Repeater control?
Ans : 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?
Ans : You must set the DataSource property and call the DataBind method.
28. What base class do all Web Forms inherit from?
Ans : The Page class.
29. Name two properties common in every validation control?
Ans : ControlToValidate property and Text property.
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?
Ans : DataTextField property.
31. Which control would you use if you needed to make sure the values in two
different controls matched?
Ans : CompareValidator control.
32. How many classes can a single .NET DLL contain?
Ans : It can contain many classes.33. What is ViewState?
Ans : 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 to retain the state of server-side objects between post backs.
34. What is the lifespan for items stored in ViewState?
Ans : Item stored in ViewState exist for the life of the current page. This
includes postbacks (to the same page).
35. What does the "EnableViewState" property do? Why would I want it on or off?
Ans : It allows the page to save the users input on a form across postbacks. It
saves the server-side values for a given control into ViewState, which is stored
as a hidden value on the page before sending the page to the clients browser.
When the page is posted back to the server the server control is recreated with
the state stored in viewstate.
36. What are the different types of Session state management options available
with ASP.NET?
Ans : ASP.NET provides In-Process and Out-of-Process state management.
In-Process stores the session in memory on the web server. This requires the a
"sticky-server" (or no load-balancing) so that the user is always reconnected to
the same web server. Out-of-Process Session state management stores data in an
external data source. The external data source may be either a SQL Server or a
State Server service. Out-of-Process state management requires that all objects
stored in session are serializable.
37. What is CLS (Common Language Specificaiton)?
Ans : It provides the set of specificaiton which has to be adhered by any new
language writer / Compiler writer for .NET Framework. This ensures
Interoperability. For example: Within a ASP.NET application written in C#.NET
language, we can refer to any DLL written in any other language supported by
.NET Framework. As of now .NET Supports around 32 languages.
38. What is CTS (Common Type System)?
Ans : It defines about how Objects should be declared, defined and used within
.NET. CLS is the subset of CTS.
39. What is Boxing and UnBoxing?
Ans : Boxing is implicit conversion of ValueTypes to Reference Types (Object).
UnBoxing is explicit conversion of Reference Types (Object) to its equivalent
ValueTypes. It requires type-casting.
40. What is the difference between Value Types and Reference Types?
Ans : Value Types uses Stack to store the data where as the later uses the Heap
to store the data.
41. What are the different types of assemblies available and their purpose?
Ans : Private, Public/shared and Satellite Assemblies.
Private Assemblies : Assembly used within an application is known as private
assemblies.
Public/shared Assemblies : Assembly which can be shared across application is
known as shared assemblies. Strong Name has to be created to create a shared
assembly. This can be done using SN.EXE. The same has to be registered using
GACUtil.exe (Global Assembly Cache).
Satellite Assemblies : These assemblies contain resource files pertaining to a
locale (Culture+Language). These assemblies are used in deploying an Gloabl
application for different languages.
42. 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.
43. What are user controls and custom controls?
Custom controls: A control authored by a user or a third-party software vendor
that does not belong to the .NET Framework class library. This is a generic term
that includes user controls. A custom server control is used in Web Forms
(ASP.NET pages). A custom client control is used in Windows Forms applications.
User Controls: In ASP.NET: A user-authored server control that enables an
ASP.NET page to be re-used as a server control. An ASP.NET user control is
authored declaratively and persisted as a text file with an .ascx extension. The
ASP.NET page framework compiles a user control on the fly to a class that
derives from the System.Web.UI.UserControl class.
41. What are the validation controls? A set of server controls included with
ASP.NET that test user input in HTML and Web server controls for
programmer-defined requirements. Validation controls perform input checking in
server code. If the user is working with a browser that supports DHTML, the
validation controls can also perform validation using client script.
45. What's the difference between Response.Write() andResponse.Output.Write()?
The latter one allows you to write formattedoutput.
46. What methods are fired during the page load? Init()
When the page is instantiated, Load() - when the page is loaded into server
memory,PreRender () - the brief moment before the page is displayed to the user
as HTML, Unload() - when page finishes loading.
47. Where does the Web page belong in the .NET Framework class hierarchy?
System.Web.UI.Page
48. Where do you store the information about the user's locale?
System.Web.UI.Page.Culture
49. What's the difference between Codebehind="MyCode.aspx.cs" and Src="MyCode.aspx.cs"?
CodeBehind is relevant to Visual Studio.NET only.
50. What's a bubbled event? When you have a complex control, likeDataGrid,
writing an event processing routine for each object (cell, button,row, etc.) is
quite tedious. The controls can bubble up their eventhandlers, allowing the main
DataGrid event handler to take care of its constituents. Suppose you want a
certain ASP.NET function executed on MouseOver over a certain button.