1. What is ASP.NET?
ASP.NET is a web application framework developed and marketed by Microsoft to allow programmers to build dynamic web sites, web applications and web services. It was first released in January 2002 with version 1.0 of the .NET Framework, and is the successor to Microsoft's Active Server Pages (ASP) technology. ASP.NET is built on the Common Language Runtime (CLR), allowing programmers to write ASP.NET code using any supported .NET language. The ASP.NET SOAP extension framework allows ASP.NET components to process SOAP messages.
2. What are the advantages of using ASP.NET?
• Web application exists in compiled form on the server so the execution speed is faster as compared to the interpreted scripts.
• ASP.NET makes development simpler and easier to maintain with an event-driven, server-side programming model.
• Being part of .Framework, it has access to all the features of .Net Framework.
• Content and program logic are separated which reduces the inconveniences of program maintenance.
• ASP.NET makes for easy deployment. There is no need to register components because the configuration information is built-in.
• To develop program logic, a developer can choose to write their code in more than 25 .Net languages including VB.Net, C#, JScript.Net etc.
• Introduction of view state helps in maintaining state of the controls automatically between the postbacks events.
• ASP.NET offers built-in security features through windows authentication or other authentication methods.
• Integrated with ADO.NET.
• Built-in caching features.
3. Explain the ASP.NET page lifecycle
Life cycle stages:
Start page: Properties such as Request and Response are set. At this stage, the page also determines whether the request is a postback or a new request and sets the IsPostback property.
Initialization: Controls on the page are available and each control's UniqueId property is set. A master page and themes are also applied to the page if applicable.
Load: If the current request is a postback, control properties are loaded with information recovered from view state and control state
Postback: Event handling if the current request is a postback, control properties are loaded with information recovered from view state and control state
Rendering: The page calls the Render method for each control, providing a text writer that writes its output to the OutputStream object of the page's Response property.
Unload: The Unload event is raised after the page has been fully rendered, sent to the client, and is ready to be discarded. At this point, page properties such as Response and Request are unloaded and cleanup is performed.
4. What happens in Preinit event?
Raised after the start stage is complete and before the initialization stage begins. This event can be used for doing following:
· Check the IsPostBack property to determine whether this is the first time the page is being processed. The IsCallback and IsCrossPagePostBack properties have also been set at this time.
· Create or re-create dynamic controls.
· Set a master page dynamically.
· Set the Theme property dynamically.
· Read or set profile property values.