Link to home
Start Free TrialLog in
Avatar of djdidge
djdidge

asked on

Webform unload event - Easy question for somebody!

I create my event from the event section of the property window...

            private void wfTimesheet_Unload(object sender, System.EventArgs e)
            {
                  Response.Write("test test test tset");
            }

I put a breakpoint on the Response.Write....  It never gets there..

What am I doing wrong?!

Regards,

DiDGE
Avatar of djdidge
djdidge

ASKER

all I want to do is run a stored procedure on window close....
ASKER CERTIFIED SOLUTION
Avatar of vinodhsomasekharan
vinodhsomasekharan

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of djdidge

ASKER

thanks, ill give it a go....

Seems odd that the unload event doesnt allow this though..
Avatar of djdidge

ASKER

Hi,
I'm getting there I think. I understand the concept. But there are a few niggles.
In its preset state the web form wfClearBlankRows.aspx is never touched. (breakpoint tested).
(note that im new to Javascript!)

also.....  myIFrame.location is not exposed by the intellisense.

Here is the cropped code so far....................

<HTML>
      <HEAD>
            <title>Time Keeping</title>
            <base target="_self">
            <meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
            <meta content="Visual Basic .NET 7.1" name="CODE_LANGUAGE">
            <meta content="JavaScript" name="vs_defaultClientScript">
            <meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
            <!-- <LINK href="styles/evolve.css" type="text/css" rel="stylesheet"> -->
            
            <script>
            function beforeClose()
            {
                      myIFrame.location.href = "wfClearBlankRows.aspx";  
            }
            </script>
            
      </HEAD>
      <body onbeforeunload="beforeClose();" MS_POSITIONING="GridLayout">
            <form id="Form1" method="post" runat="server">
                  <iframe id="myIFrame" style="DISPLAY: none" name="myIFrame" src="" runat="server"></iframe>



Avatar of djdidge

ASKER

I couldnt quite get it to work... but the logic is there.

Closed the queston to be tidy....

Thanks - didge