Re: beginning page load immediately on postback with a long load time ?
From: bruce barker (nospam_brubar_at_safeco.com)
Date: 06/30/04
- Next message: bruce barker: "Re: Security?"
- Previous message: tfs: "ASP and DTS Packages"
- In reply to: John Saunders: "Re: beginning page load immediately on postback with a long load time ?"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 29 Jun 2004 18:05:57 -0700
you also have to control the timing of the disable to happen after postback
as disabled fields are not posted by the browser. dropdown with autopostback
also will have problems if the user uses arrow keys to access the dropdown
values (tries to post on every selection)
-- bruce (sqlwork.com)
"John Saunders" <johnwsaundersiii@notcoldmail.com> wrote in message
news:uYVhWQiXEHA.2972@tk2msftngp13.phx.gbl...
> "Mad Scientist Jr" <usenet_daughter@yahoo.com> wrote in message
> news:7a93f3c4.0406291139.13123a33@posting.google.com...
> > i have a dropdown control with autopostback=on that when selected,
> > posts back and populates a second dropdown. the 2nd dropdown takes a
> > while to load, giving the user time to start typing in other fields
> > before the screen refreshes. i would like to disable any user input
> > during this time.
> >
> > I was thinking if it was possible to force the browser to begin
> > loading the page immediately that it would erase the controls that are
> > there and the user would be forced to wait (wouldn't be able to press
> > any buttons, type in any textboxes etc) for the page to refresh.
> >
> > I started playing around with Response.Buffer/Flush but it didn't
> > work. Any ideas on if this is possible and if so how to get it to
> > work?
>
> The problem is something like this:
>
> 1, User requests page.aspx
> 2. Server sends back html for page.aspx, including your dropdown with
> autopostback on.
> 3. User changes selection in dropdown.
> 4. Page posts back to the server
> 5. User starts typing into the html sent back in 2.
> 6. Server sends back html for posted-back page.aspx, including your loaded
> second dropdown, overwriting whatever the user had typed.
>
> So you see, what you would need to do is disable the controls on the page
> just before the postback begins. When the new html comes back, it will
come
> back with enabled controls.
>
> This will take a bit of JavaScript in the onchange event of the dropdown.
> That script would have to run through the DOM and set the disabled
property
> of all relevant objects to true.
>
> Now, I can't get you an example. I needed to do this in a control once,
and
> had a bit of trouble with it. Only certain objects in the DOM implement
the
> disabled property. Also, in some cases, setting the disabled property will
> disable all contained objects, but sometimes it won't and you'll have to
> iterate into the child objects. Also, I seem to remember that under some
> circumstances, I couldn't entirely disable an anchor object, and had to
> screw with the URL instead.
>
> Of course, another option would be to follow one of the various strategies
> for producing a "Waiting..." page.
> --
> John Saunders
> johnwsaundersiii at hotmail
>
>
- Next message: bruce barker: "Re: Security?"
- Previous message: tfs: "ASP and DTS Packages"
- In reply to: John Saunders: "Re: beginning page load immediately on postback with a long load time ?"
- Messages sorted by: [ date ] [ thread ]