ASP.NET

1. ASP.NET Introduction 2. Comp of .Net Framework 3.5 3. Sys.Req for VS 2008 4. ASP.NET Envrmnt Setup 5. VS2010 Ultimate Sys.Req 6. Installing VS 2010 7. VS 2012 Sys.Req 8. Installing VS Exp 2012 9. Start the VS 2008 10. Application Life Cycle 11. Page Life Cycle 12. Page Life Cycle Events 13. ASP.NET Example 14. Event Handling 15. Default Events 16. Server Side 17. Request Object 18. Response Object 19. Server Controls 20. Server Controls Properties 21. Server Controls Methods 22. HTML Server Controls 23. Client Side 24. ASP.NET Basic Controls 25. TextBox Control 26. CheckBox Controls 27. RadioButton Controls 28. ListBox Control 29. HyperLink Control 30. Image Control 31. BulletedList Control 32. ASP.NET Directives 33. Implements Directive 34. Master Type Directive 35. Page Directive 36. PreviousPage Type 37. Managing State 38. Control State 39. Cookies 40. Query Strings 41. Server-Side State 42. Session State 43. Validation Controls 44. Required FieldValidator 45. Range Validator 46. Compare Validator 47. RegularExpressionValidator 48. Custom Validator 49. Validation Summary 50. Data Source Control 51. AdRotator Control 52. Calendar Control 53. Calendar Control Example 54. Panel Control 55. Panel Control Example 56. Multi Views Control 57. MultiView & View controls 58. MultiView Control Example 59. FileUpload Control 60. FileUpload Control Eg 61. AJAX Control 62. UpdatePanel control 63. UpdateProgress Control 64. Custom Controls 65. Custom Control Eg 66. Personalization 67. Create Simple Profile 68. ADO.NET 69. ADO.NET Objects 70. DataTable 71. DataRow 72. DataColumn 73. Object Example 74. Error Handling 75. Tracing Errors 76. Debugger 77. Security 78. Authentication 79. Authorization 80. LINQ 81. LINQ Query Operators 82. LINQ Example 83. Caching 84. Data Caching 85. Output Caching 86. Object Caching 87. Web Services 88. Create Web Services Eg 89. Web & Machine.config 90. Settings Schema 91. ASP.NET Deployment 92. XCopy Deployment 93. Web Setup Project 94. ASP Interview Part 1 95. ASP Interview Part 2 96. ASP Interview Part 3 97. ASP Interview Part 4 98. ASP Interview Part 5 99. ASP Interview Part 6
Pr.Pg Next Pg

ASP.NET Application Life Cycle tutorials

  • Whenever the user requests for a web page the request goes to IIS (Internet Information Services). IIS then checks the ISAPI (Internet Server Application Programming Interface) extension of the request to check how to process the request. If the request is for an .aspx page then the request will be redirected to the ASP.NET.

  • When the ASP.NET engine receives the request it check whether an Application Domain exist for this request to run. If yes, it will use that application domain, if not it will create one and pass on the request to that Application domain.

  • Note: Application domain provides the actual isolation levels so that various website hosted in the same IIS servers will not interfere with each other.

  • Once the Application domain has been created the objects required to serve the incoming requests and generate the proper response are created.

  • Following objects are created to achieve the same HttpContext, HttpRequest, and HttpResponse. The HttpContext object contains the reference to the HTTPRequest and HTTPResponse (these are the object containing the information about the current request). The HTTPRequest object specifically contains the information about the current request i.e. browser related info and existing cookies. The HTTPResponse object contains the information about the response that will be sent from the server to the client i.e. cookies to be written etc.

  • Once these objects are created the object of HTTP Application will be created. This object contains the methods and events that are common for the application (the current application domain). The reason this object is of particular interest is that this object raises events that could be useful for the developer. If we have a global.asax file in our application, we can handle all the events raised by this object and perform our application specific operations (We will see the events in details later).

  • Once the HTTP Application object is done with the request initialization, authentication and authorization events, it passes the request to the Page. This is the point typically where we write most of our code. We handle all the page lifecycle events to tailor the page as per the user request.

  • Once the page processing is done, the HTTP Application will execute the cleanup and end request events and then the response will be sent to the user.


Application Events

  • Now we have understood the basic Application life cycle. The next important thing for us is to look at the Application events' sequence so that we can have our custom logic written either in global.asax file or in a module.

  • Understanding the sequence of events is important because we should know what could and should be done in each event.

  • Note: We will only look at some important and frequently used Application events. For a comprehensive list of events MSDN is a good place to look into. The following table shows the list of Application Events:

 

Event

Description

BeginRequest

This event will be called in every request. This event indicates the beginning of a new request.

AuthenticateRequest

This event is fired when the ASP.NET is ready for authentication. All the code that is for the authentication of the user should come here.

AuthorizeRequest

This event is fired when the ASP.NET is ready for authorization. All the code that is for the authorization of the user should come here.

AcquireRequestState

This event is important because at this point the AS.NET is ready to accept and play with Session variables. If we need to initialize some session variable, it could be done in here or here onwards any event.

ProcessRequest

Here the Required HTTPHandler will get executed. If it is an aspx page the respective handler will get executed and the request will be passed on to the page.

ReleaseRequestState

This event is important because this is the last point play with Session variables.

EndRequest

This event will be fired just before the response will be sent to the user.


Pr.Pg border                                              Next Pg