C
Christopher D. Wiederspan
I'm wondering if there's a way to use javascript to disable a ASP.NET web
page before it starts to postback. Specifically, here's what I'm running
into. I've got a webform that has an autopostback dropdown box, and a couple
of textboxes just below it. When the user selects an option from the
dropdown, it triggers a postback event, which in-turn slightly adjusts the
remainder of the page.
The problem is that if the user is on a slow dial-up connection, they have
time to tab down below and start filling in the textboxes before the
postback mechanism kicks in and submits the form to the server. From the
user perspective, they've selected a value from the dropdown and now they
are typing along in the textbox, and all of the sudden the page posts back.
What I would like to do is add "document.body.disabled = true;" that will
execute immediately when the postback mechanism is started. I can get this
idea working great when the postback is caused by something like a button
and I use the RegisterOnSubmitStatement method of the page class, but the
AutoPostBack feature of the dropdown list bypasses the client-side onsubmit
event (this is a know/intended "issue").
What I'm wondering if there is a way to influence the output of the
__doPostBack script that my page is rendering out? Ideally, I could just add
my disable script right there in the beginning of that script and everything
would work great.
If anybody has any ideas on this, please let me know.
Thanks,
Chris
page before it starts to postback. Specifically, here's what I'm running
into. I've got a webform that has an autopostback dropdown box, and a couple
of textboxes just below it. When the user selects an option from the
dropdown, it triggers a postback event, which in-turn slightly adjusts the
remainder of the page.
The problem is that if the user is on a slow dial-up connection, they have
time to tab down below and start filling in the textboxes before the
postback mechanism kicks in and submits the form to the server. From the
user perspective, they've selected a value from the dropdown and now they
are typing along in the textbox, and all of the sudden the page posts back.
What I would like to do is add "document.body.disabled = true;" that will
execute immediately when the postback mechanism is started. I can get this
idea working great when the postback is caused by something like a button
and I use the RegisterOnSubmitStatement method of the page class, but the
AutoPostBack feature of the dropdown list bypasses the client-side onsubmit
event (this is a know/intended "issue").
What I'm wondering if there is a way to influence the output of the
__doPostBack script that my page is rendering out? Ideally, I could just add
my disable script right there in the beginning of that script and everything
would work great.
If anybody has any ideas on this, please let me know.
Thanks,
Chris