ASP.Net Interview Question and Answers
111. |
What is a Namespace? What is the use of a namespace? |
|
Namespaces are logical grouping of classes and other types in hierarchical structure. Namespaces are useful to avoid collision or ambiguity among the classes and type names. Another use of the namespace is to arrange a group of classes for a specific purpose. |
|
|
112. |
What’s the difference between Codebehind="MyCode.aspx.cs" and Src="MyCode.aspx.cs"? |
|
Visual Studio uses the Codebehind attribute to distinguish the page source or programming logic from the design. Also the src attribute will make the page compile on every request. That is the page will not be compiled in advance and stored in the bin as a dll instead it will be compiled at run time. |
|
|
113. |
How many classes can a single .NET DLL contain? |
|
It can contain many classes. |
|
|
114. |
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.
|
|
|
115. |
What is the difference between Value Types and Reference Types? |
|
Value Types uses Stack to store the data. where as Reference type uses the Heap to store the data. |
|
|