(11)UnLoad This event is used for cleanup code. After the page’s HTML is rendered, the objects are disposed of. During this event, you should destroy any objects or references you have created in building the page. At this point, all processing has occurred and it is safe to dispose of any remaining objects, including the Page object. Cleanup can be performed on-
(a)Instances of classes i.e. objects
(b)Closing opened files
(c)Closing database connections.
EXAMPLE : Override the event as given below in your code-behind cs file of your aspx page
protected void Page_UnLoad(object sender, EventArgs e) {// This event occurs for each control and then for the page. In controls, use this event to do final cleanup for specific controls, such as closing control-specific database connections. // During the unload stage, the page and its controls have been rendered, so you cannot make further changes to the response stream. //If you attempt to call a method such as the Response.Write method, the page will throw an exception. }
Similar Topics:
- Microsoft Sharepoint persisting webpart property values
- Asp.net file compression using opensource library
- Javascript Treeview Checkbox Check All function
- Concept of OOPS in C#
- Singleton pattern – Design pattern
- Enabling IIS6 HTTP compression on SharePoint dynamic page
- Email asp net Sending email using godaddy hosting account
- Microsoft Sharepoint SystemUpdate and Update using object model
- Outlook Web Access corrupts HTML attachments
- Asp.net sending email with zip file as attachment