R
Roy Scarisbrick
I have a programming issue on an ASP.Net web page. I suspect the issue would
apply to any version of ASP though.
I have a questionnaire page where a user will answer a bunch of questions
with radio buttons and text boxes. At the bottom of the page is a button
that he is to click when he's done. The event behind the button will write
the data to the database and redirect him to a Thanks page.
The issue is what happens if the user supplies the data, then just closes
the browser window. As it is, the data doesn't get written. There is a
Page_Unload event that I don't understand completely. First, it fires when
the page has finished loading, which I've read is expected, and second, when
the page is closed there doesn't seem to be much you can actually do there,
as by the time the event fires, the session is closed. That is documented as
well.
My question is: how can I ensure the data gets written? Are there
traditional ways to stop a browser window from being closed, or at least to
call another sub when it is?
Roy Scarisbrick, B.A. (Economics), Certified Engineering Technologist
Calgary, Alberta, Canada, T2P 4H3
www.HeadwaySystems.com
apply to any version of ASP though.
I have a questionnaire page where a user will answer a bunch of questions
with radio buttons and text boxes. At the bottom of the page is a button
that he is to click when he's done. The event behind the button will write
the data to the database and redirect him to a Thanks page.
The issue is what happens if the user supplies the data, then just closes
the browser window. As it is, the data doesn't get written. There is a
Page_Unload event that I don't understand completely. First, it fires when
the page has finished loading, which I've read is expected, and second, when
the page is closed there doesn't seem to be much you can actually do there,
as by the time the event fires, the session is closed. That is documented as
well.
My question is: how can I ensure the data gets written? Are there
traditional ways to stop a browser window from being closed, or at least to
call another sub when it is?
Roy Scarisbrick, B.A. (Economics), Certified Engineering Technologist
Calgary, Alberta, Canada, T2P 4H3
www.HeadwaySystems.com