Q. What is an interface class in c# languages ?
A. Interface is an abstract class which has only public abstract methods and the methods only have the declaration and not the definition. These abstract methods must be implemented in the inherited classes.
Q. Explain value types and reference types ?
A. Value types are stored in the Stack whereas reference types stored on heap.
Value types:
int, enum , byte, decimal, double, float, long
Reference Types:
string , class, interface, object
Q. What is the difference between web config and machine config?
A. Web config file is specific to a web application where as machine config is specific to a machine or server. There can be multiple web config files into an application where as we can have only one machine config file on a server.
Q. In which event are the controls fully loaded?
A. Page load event.
Q. Explain boxing and unboxing in asp.net web application?
A. Boxing is assigning a value type to reference type variable.
Unboxing is reverse of boxing ie. Assigning reference type variable to value type variable.
Q. What is the PostBack property in ASP.NET?
A. If we create a web Page, which consists of one or more Web Controls that are configured to use AutoPostBack (Every Web controls will have their own AutoPostBack property), the ASP.NET adds a special JavaScipt function to the rendered HTML Page. This function is named _doPostBack() . When Called, it triggers a PostBack, sending data back to the web Server. ASP.NET also adds two additional hidden input fields that are used to pass information back to the server. This information consists of ID of the Control that raised the event and any additional information if needed.
These fields will empty initially as shown below,
The following actions will be taken place when a user changes a control that has the AutoPostBack property set to true:
On the client side, the JavaScript _doPostBack function is invoked, and the page is resubmitted to the server.
ASP.NET re-creates the Page object using the .aspx file.
ASP.NET retrieves state information from the hidden view state field and updates the controls accordingly.
The Page.Load event is fired.
The appropriate change event is fired for the control. (If more than one control has been changed, the order of change events is undetermined.)
The Page.PreRender event fires, and the page is rendered (transformed from a set of objects to an HTML page).
Finally, the Page.Unload event is fired.
The new page is sent to the client.