ASP .Net

Asp.Net Faqs, Asp.Net interview questions,

How can we identify that the Page is PostBack ?

Page object has a “IsPostBack” property which can be checked to know that is the page posted back.

In which event are the controls fully loaded ?

Page_load event guarantees that all controls are fully loaded. Controls are also accessed in Page_Init events but you will see that viewstate is not fully loaded during this event.

What’ is the sequence in which ASP.NET events are processed ?

Following is the sequence in which the events occur :- ?   Page_Init.

?   Page_Load.

?   Control events

?   Page_Unload event.

Page_init event only occurs when first time the page is started, but Page_Load occurs in subsequent request of the page.

Choosing between HTTP and TCP for protocols and Binary and SOAP for formatters, what are the trade-offs?

Binary over TCP is the most effiecient, SOAP over HTTP is the most interoperable.

How do you create a permanent cookie?

Setting the Expires property to MinValue means that the Cookie never expires.

What property must you set, and what method must you call in your code, in order to bind the data from some data source to the Repeater control?

You must set the DataSource property and call the DataBind method.

How do you turn off cookies for one page in your site?

Use Cookie.Discard property, Gets or sets the discard flag set by the server. When true, this property instructs the client application not to save the Cookie on the user’s hard disk when a session ends.

Which method do you use to redirect the user to another page without performing a round trip to the client?

Server.transfer

What method do you use to explicitly kill a user s session?

You can dump (Kill) the session yourself by calling the method Session.Abandon.

ASP.NET automatically deletes a user’s Session object, dumping its contents, after it has been idle for a configurable timeout interval. This interval, in minutes, is set in the <SESSIONSTATE>section of the web.config file. The default is 20 minutes.

What tag do you use to add a hyperlink column to the DataGrid?

< asp:HyperLinkColumn > </ asp:HyperLinkColumn>