473,770 Members | 1,939 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

beginning page load immediately on postback with a long load time ?

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?

Thanks

Sample code:

Private Sub Dropdown1_Selec tedIndexChanged (ByVal sender As
System.Object, ByVal e As System.EventArg s) Handles
cboBroker_Alpha .SelectedIndexC hanged
' CLEAR PAGE SO USER DOESN'T HAVE TIME TO WAIT AROUND AND START
TYPING IN OTHER CONTROLS
Response.Buffer = True
Response.Flush( )
(CODE THAT TAKES A LONG TIME TO RUN HERE...)
Nov 18 '05 #1
7 4530
"Mad Scientist Jr" <us************ *@yahoo.com> wrote in message
news:7a******** *************** ***@posting.goo gle.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
johnwsaundersii i at hotmail
Nov 18 '05 #2
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" <jo************ **@notcoldmail. com> wrote in message
news:uY******** ******@tk2msftn gp13.phx.gbl...
"Mad Scientist Jr" <us************ *@yahoo.com> wrote in message
news:7a******** *************** ***@posting.goo gle.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
johnwsaundersii i at hotmail

Nov 18 '05 #3
>4. Page posts back to the server

What I want to do is for the page to post some whitespace back to the
server, say a single space character, so the page in the user's browser
is temporarily blanked out, so they can't type anything. Then when the
server is done processing, it sends the postback page. Is that possible?
*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 18 '05 #4
"Emma Gumbdough" <us************ *@yahoo.com> wrote in message
news:uh******** ******@tk2msftn gp13.phx.gbl...
4. Page posts back to the server


What I want to do is for the page to post some whitespace back to the
server, say a single space character, so the page in the user's browser
is temporarily blanked out, so they can't type anything. Then when the
server is done processing, it sends the postback page. Is that possible?


Actually, no, it doesn't even make sense. The "page", in the users browser,
posts form data back to the server. The server then sends HTML back in
response.

See
Indicating Progress
http://msdn.microsoft.com/library/de...pplication.asp
for some examples on progress.
--
John Saunders
johnwsaundersii i at hotmail

Nov 18 '05 #5
Yes. And when the page posts back, the codebehind BEGINS rendering the
postback page, and flushes the buffer (which would contain some
whitespace or maybe the header). The client then has a partial response
in their browser (this will probably appear as a blank screen) and thus
cannot type in any fields until the entire page loads. The server then
continues to process and sends the remaining response to the client, at
which point they can type again.


*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 18 '05 #6
"Emma Gumbdough" <us************ *@yahoo.com> wrote in message
news:ek******** ******@TK2MSFTN GP12.phx.gbl...
Yes. And when the page posts back, the codebehind BEGINS rendering the
postback page, and flushes the buffer (which would contain some
whitespace or maybe the header). The client then has a partial response
in their browser (this will probably appear as a blank screen) and thus
cannot type in any fields until the entire page loads. The server then
continues to process and sends the remaining response to the client, at
which point they can type again.


I wouldn't count on TCP/IP to be deterministic, even in the presence of a
Flush call. If you want to make sure they don't type anything, you need to
handle it on the client. You don't even have control over how much time
passes after the user changes selection in the dropdown and before Page_Load
starts.
--
John Saunders
johnwsaundersii i at hotmail
Nov 18 '05 #7
I ended up just putting the slow dropdowns on a different screen.

The 'waiting' page idea sounded good but how would it be implemented -
as a popup? Can the main page be given a RegisterStartup Script or
register client side script that would be able to automatically close
the popup (assuming it is a child of that browser) upon completion of
loading?
you also have to control the timing of the disable to happen after

postback as disabled fields are not posted by the browser

*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 18 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
3053
by: Workgroups | last post by:
I've got a page where the nature of the beast is such that the user clicks a submit button to ransomize some data in somewhat rapid succession (once per second, give or take). The page generates a little table, 10x10, of small pictures that represent the randomized data. The submit button tells the server (which is keeping track of which pictures are where) to scramble them around and output a new table. The output is simple HTML. The...
1
1334
by: szabelin | last post by:
Hello, what is the page directive (was it meta something?) that causes page go call the server at predefined intervals? I used to have a link to sample code but it's broken now. thanks
2
5005
by: Sam | last post by:
I have a custom control (MyTextBox - taken from Microsoft website) that implements the IPostBackDataHandler interface. It is added to the controls collection of a placeholder control during the Page Load of a main ASPX page. Now if we debug the MyTextBox, we find the order of events like so (during a Posback, of course): OnInit -> OnLoad -> LoadPostData. My question is why does the LoadPostData occur *after* the OnLoad instead of...
2
3629
by: John Lau | last post by:
Hi, Is there documentation that talks about the page lifecycle, the lifecycle of controls on the page, and the rendering of inline code, in a single document? Thanks, John
5
2082
by: DCC-700 | last post by:
I am using ASP.Net with VB on the 1.1 Framework running on Win XP Pro. I am trying to gauge the time it takes to sort a datagrid using different code sets. But when I am debugging the page there is a long delay before hitting breakpoint in page load. When I initially load the page I hit the breakpoint right away. Then I click on a Sort header in a datagrid, and it takes about 1:45 before the breakpoint (first statement in Page Load) is...
10
2936
by: Tim_Mac | last post by:
hi, i would like to display a discreet message on all my pages indicating how long the server took to render the page. full tracing is not an option because it would freak out my non-technical users! i've looked around online and can find nothing to do this, or in the SDK docs. i thought .Net 2.0 would have something more out-of-the-box for this type of performance measuring but i can't find any. i was thinking about running a timer...
3
8707
by: Nathan Sokalski | last post by:
I am recieving the following error on the second postback of a page I have written: The state information is invalid for this page and might be corrupted Stack Trace: System.Convert.FromBase64String(String s) +0
14
23170
by: lmttag | last post by:
Hello. We're developing an ASP.NET 2.0 (C#) application and we're trying to AJAX-enable it. We're having problem with a page not showing the page while a long-running process is executing. So, we're looking for a way to display the page with a "please wait..." message while the process is running, and then, when the process is done, update the page with the actual results/page content. We have a page that opens another browser/page...
4
3108
by: Mantorok | last post by:
Hi ASP.Net v2.0 I have a page and, depending on circumstances, it can sometimes take between 10-30 seconds to load, this is due to a dependency on a 3rd party web-service that is very slow.. Is there anyway of informing the user that the server hasn't died and that the page is busy fetching results?
0
9425
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10231
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10059
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10005
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9871
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8887
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6679
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5452
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3576
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.