Tuesday 7 March 2017

ASP.NET interview questions Part-6

1. Ques: Explain the two different types of remote object creation mode in .NET?
Answer:
The two different ways by which object can be created using Remoting is:-
  • SAO (Server Activated Object): It lasts the lifetime of the server. They are activated as SingleCall/Singleton objects. It makes objects stateless. A SingleCall object gets created for each request by client and A Singleton object is created once on the server and is shared by all the clients.
  • CAO (Client Activated Objects): CAO creates stateful objects. The object creation request is based on the request by client side. Therefore, the lifetime is based on client and not server. Single instance of object is created for every call.

2. Ques:  Explain the role of inetinfo.exe aspnet_isapi.dll and aspnet_wp.exe ?
Answer:
Inetinfo.exe is the Microsoft IIS server running, handling ASP.NET requests among other
things.When an ASP.NET request is received (usually a file with .aspx extension), the ISAPI filter aspnet_isapi.dll takes care of it by passing the request to the actual worker process aspnet_wp.exe.


3. Ques:  What’s the difference between Response.Write() and Response.Output.Write()? 
Answer:

Response.Write()

  • Response.Write() does not allows you to write formatted output.
  • It writes the text stream.
  • It just output a string to web page.

Response.Output.Write()

  • Response.Output.Write() allows you to write formatted output.
  • It writes the HTTP Output Stream.
  • it formats the string and then write to web page.


4. Ques:  When during the page processing cycle is ViewState available?
Answer:
After the Init() and before the Page_Load(), or OnLoad() for a control.


5. Ques: In what order do the events of an aspx page execute ?
Answer:
These are the order of Page events
Page_PreInit
Page_Init
Page_LoadViewState
Page_LoadPostData
Page_Load
Page_RaisePostDataChanged
Page_RaisePostBackEvent
Page_PreRender
Page_SaveViewState
Page_Render
Page_Dispose
Page_Error (this is caused whenever there is an exception at the page level).


6. Ques:  What are the contents of assembly?
Answer:
A assembly can consist of four elements:
  • Assembly manifest:Contains the assembly metadata. An assembly manifest contains the information about the identity and version of the assembly. 
  • It also contains the information required to resolve references to types and resources.
  • Type metadata - Binary information that describes a program.
  • Microsoft intermediate language (MSIL) code.
  • A set of resources.

7. Ques: What is the difference between ‘Web.config’ and ‘Machine.config’?
Answer:
  • Web.config files are used to apply configuration settings to a particular web application.
  • machine.config file is used to apply configuration settings for all the websites on a web server.
  • Web.config files are located in the application's root directory or inside a folder situated in a lower hierarchy. 
  • The machine.config is located in the Windows directory Microsoft.Net\Framework\Version\CONFIG.
  • There can be multiple web.config files in an application nested at different hierarchies. 
  • However there can be only one machine.config file on a web server.

8. Ques:  What is a Query String in ASP.Net?  What are the Benefits and limitations of a Query String in ASP.Net?
Answer:
QueryString is way to transfer information from one page to another through the URL.
A Query String is helpful when we want to transfer a value from one page to another. When we need to pass content between the HTML pages or aspx Web Forms in the context of ASP.NET, a Query String is very easy to use and the Query String follows a separating character, usually a Question Mark (?)

Benefits 
  • Supported by all the browsers
  • No extra effort is needed to code.
  • Easy to use.
limitations 
  • All the attributes and values are visible to the end user. Therefore, they are not secure. 
  • There is a limit to URL length of 255 characters.

No comments:

Post a Comment

Thank you for comment