Pages

Wednesday, December 10, 2008

ASP.Net Interview Questions - Part 2

Where do you store the information about the user’s locale?

Ans :System.Web.UI.Page.Culture.


What’s the difference between Codebehind="MyCode.aspx.cs" and
Src="MyCode.aspx.cs"?

Ans : CodeBehind is relevant to Visual Studio.NET only.


What’s a bubbled event?

Ans :When you have a complex control, like DataGrid, 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.


Where do you add an event handler?

Ans :It’s the Attributesproperty, the Add function inside that property. So
btnSubmit.Attributes.Add("onMouseOver","someClientCode();") A simple”Javascript:ClientCode();” in the button control of the .aspx page will attach the handler (javascript function)to the onmouseover event..


What data type does the RangeValidator control support?

Ans :Integer,String and Date..


Where would you use an iHTTPModule, and what are the limitations of any
approach you might take in implementing one?

Ans :One of ASP.NET’s most useful features is the extensibility of the HTTP pipeline, the path that data takes between client and server. You can use them to extend your ASP.NET applications by adding pre- and post-processing to each HTTP request coming into your application. For example, if you wanted custom authentication facilities for your application, the best technique would be to intercept the request when it comes in and process the request in a
custom HTTP module..


Explain what a diffgram is and a good use for one?

Ans :A DiffGram is an XML format that is used to identify current and original versions of data elements. The DataSet uses the DiffGram format to load and persist its contents, and to serialize its contents for transport across a network connection. When a DataSet is written as a DiffGram, it populates the DiffGram with all the necessary information to accurately recreate the contents, though not the schema, of the DataSet, including column values from both the Original and Current row versions, row error information, and row order..


What is datagrid?

Ans :The DataGrid Web server control is a powerful tool for displaying information from a data source. It is easy to use; you can display editable data in a professional-looking grid by setting only a few properties. At the same time, the grid has a sophisticated object model that provides you with great flexibility in how you display the data..


What’s the difference between the System.Web.UI.WebControls.DataGrid and and
System.Windows.Forms.DataGrid?

Ans :The Web UI control does not inherently support master-detail data structures. As with other Web server controls, it does not support two-way data binding. If you want to update data, you must write code to do this yourself. You can only edit one row at a time. It does not
inherently support sorting, although it raises events you can handle in order to sort the grid contents. You can bind the Web Forms DataGrid to any object that supports the IEnumerable interface. The Web Forms DataGrid control supports paging. It is easy to customize the appearance and layout of the Web Forms DataGrid control as compared to the Windows Forms one.


How do you customize the column content inside the datagrid?

Ans : If you want to customize the content of a column, make the column a template column. Template columns work like item templates in the DataList or Repeater control, except that you are defining the layout of a column rather than a row.


How do you apply specific formatting to the data inside the cells?

Ans :You cannot specify formatting for columns generated when the grid’s
AutoGenerateColumns property is set to true, only for bound or template columns. To format, set the column’s DataFormatString property to a string-formatting expression suitable for the data type of the data you are formatting.


How do you hide the columns?

Ans :One way to have columns appear dynamically is to create them at design time, and then to hide or show them as needed. You can do this by setting a column’s Visible property.

No comments: