J
Jim Hammond
The code below works except that calling Server.Transfer generates the
following exception, and I don't know why yet:
"Error executing child request for Form_Welcome.aspx."
Although a page has a short lifespan, I have discovered that the timer
callback is in fact being called after 10 seconds.
Notet hat "p" appears to be perfectly valid and returns equal when compared
to the original Web Form object, which I saved using Application.Add
specifically to test for such equality.
private void Page_Load(object sender, System.EventArgs e)
{
// Set timer to call Page_PostLoad in 10 seconds
timerDelegate = new TimerCallback(Page_PostLoad);
timer = new Timer( timerDelegate, this, 10000, 0 );
}
static void Page_PostLoad(Object page)
{
Form_ProceedToDesk p = (Form_ProceedToDesk)page;
try
{
// stop timer
p.timer.Dispose();
p.timer = null;
p.GoHome();
}
catch(Exception ex)
{
p.ExceptionDisplay( ex );
}
}
public void GoHome( )
{
Server.Transfer("Form_Welcome.aspx");
}
following exception, and I don't know why yet:
"Error executing child request for Form_Welcome.aspx."
Although a page has a short lifespan, I have discovered that the timer
callback is in fact being called after 10 seconds.
Notet hat "p" appears to be perfectly valid and returns equal when compared
to the original Web Form object, which I saved using Application.Add
specifically to test for such equality.
private void Page_Load(object sender, System.EventArgs e)
{
// Set timer to call Page_PostLoad in 10 seconds
timerDelegate = new TimerCallback(Page_PostLoad);
timer = new Timer( timerDelegate, this, 10000, 0 );
}
static void Page_PostLoad(Object page)
{
Form_ProceedToDesk p = (Form_ProceedToDesk)page;
try
{
// stop timer
p.timer.Dispose();
p.timer = null;
p.GoHome();
}
catch(Exception ex)
{
p.ExceptionDisplay( ex );
}
}
public void GoHome( )
{
Server.Transfer("Form_Welcome.aspx");
}