Main () and static constructor in same class which one will execute first?
What is the default life of cookie?
You can read the name and value of a cookie, but there is not much else to learn about a cookie. You can get the Domain and Path properties, but those properties are of limited use. For example, you can read the Domain property, but of course if your page is not in the same domain as the cookie, you will not have received the cookie in the first place.
What you cannot read is the cookie's expiration date and time. It turns out that when the browser sends cookie information to the server, the browser does not include the expiration information. You can read the Expires property, but it always returns a date-time value of zero.
Earlier under Writing Cookies I mentioned that the browser is responsible for managing cookies; the Expires property is an example of this. The primary purpose of the Expires property is to help the browser perform housekeeping on its store of cookies. From the server's perspective, the cookie either exists or it does not; the expiration is not a useful piece of information on the server side. Therefore, the browser does not provide this information when it sends the cookie. If you are concerned about the expiration date of a cookie, you must reset it, as I will explain shortly under Modifying and Deleting Cookies.
To be clear, you can read the Expires property of a cookie that you have set in the Response object, before the cookie has been sent to the browser. However, you cannot get the expiration back in the Request object.
Can I implement link button click event within gridview?
Yes. we can I implement link button click event within gridview
Handle click event of linkbutton through code -
<asp:GridView AutoGenerateColumns="false" runat="server" ID="grdCustomPagging"OnRowCommand="grdCustomPagging_RowCommand">
<asp:BoundField DataField="RowNumber" HeaderText="RowNumber" />
<asp:BoundField DataField="DealId" HeaderText="DealID" />
<asp:BoundField DataField="Dealtitle" HeaderText="DealTitle" />
<asp:LinkButton runat="server" ID="lnkView" CommandArgument='<%#Eval("DealId") %>'
protected void grdCustomPagging_RowCommand(object sender, GridViewCommandEventArgs e)
if (e.CommandName == "VIEW")
LinkButton lnkView = (LinkButton)e.CommandSource;
string dealId = lnkView.CommandArgument;
What is advantage of stored procedure?
Stored procedures provide performance benefits through local storage, precompiling the code, and caching.
Stored procedures offers security features that includes encryption and privilege limits that restrict users from modifying structure of stored procedure.
What are the programming techniques will be supporting by asp.net?
Why we can’t create object for abstract class and interface?
An abstract type is defined largely as one that can't be created. You can create subtypes of it, but not of that type itself. The CLI will not let you do this.
An abstract class has a protected constructor (by default) allowing derived types to initialize it.
For example, the base-type Stream is abstract. Without a derived type where would the data go? What would happen when you call an abstract method? There would be no actual implementation of the method to invoke.
How to divide the page into different parts?
What is Rendering?
Rendering refers to the process of creating a visual representation on a display surface. In the case of Web requests, the actual rendering is performed by a client's Web browser or other viewing device. The task of the ASP.NET page framework is to send HTML (or text in another markup language such as XML or WML) in response to a Web request. The task of a page (and its child controls) is to write the markup content to an output stream.
What does Rendering mean?
How to assign null value into value type variable?
We have to go for NULLABLE VALUE TYPES.
Syntax: <ValueType> ? <VariableName>=NULL;
you have to make it nullable type by using the "? "
< data_type> ? <variable_name> = null;
Why static constructor is a parameter less constructor?
Static constructor executes at the time of class loading. There is no need to pass values explicitly, so it doesn't have parameters.
A static constructor is called automatically to initialize the class before the first instance is created. Therefore you can't send it any parameters. ... Because you can't call it directly (as per MSDN): A static constructor cannot be called directly