Posted on: 3/17/2011 10:09:01 PM | Views : 919

Hello,
I'd like to have a server-side event fire when my ASP.NET form is unloaded, to save it's state.  I've looked around on the web and found the OnDisposed method, but I can't figure out how to trigger it.  Here's an example:
 
<%@ Page Language="VB" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <script runat="server"> </script> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> <script runat="server" language="VB"> Protected Sub Dispose_Button(ByVal s As Object, ByVal e As System.EventArgs) Dim bar As Integer = 1 'Put a breakpoint here NEVER GETS HIT Label1.Text = "Hello World" End Sub ...

Go to the complete details ...