473,396 Members | 1,738 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Draw page before Page_Load() ?


I have a long operation I want to run when my page first appears, so I
put it in Page_Load().

However the browser doesn't draw the contents of the page until after
Page_Load() is complete, though I wish it would.

Am I putting my operation in the wrong place? Where do I put a process
that I want run immediately after the page is first completely shown?

thanks much
dp

Oct 9 '06 #1
3 1603
However the browser doesn't draw the contents of the page until after
Page_Load() is complete, though I wish it would.
The browser draws the page once it receives all the HTML.
Am I putting my operation in the wrong place? Where do I put a process
that I want run immediately after the page is first completely shown?
Once the page is completely shown, it's done with the server. The
transaction is complete. By the time your browser starts getting the HTML,
all your code has already been completely executed server-side.

The only option off the top of my head would be to do all this via ajax.
Load the page, then call the long process you are running via a javascript
call on the page, which will then update the relevant portion via AJAX. Of
course, using AJAX brings in a bunch of accessibility/usability issues that
you'd want to weigh as well.

-Darrel
Oct 9 '06 #2
q
What are we talking about? Please state your purpose.

Also, do you mean client-side or server-side?


da*****@hotmail.com wrote:
I have a long operation I want to run when my page first appears, so I
put it in Page_Load().

However the browser doesn't draw the contents of the page until after
Page_Load() is complete, though I wish it would.

Am I putting my operation in the wrong place? Where do I put a process
that I want run immediately after the page is first completely shown?

thanks much
dp
Oct 9 '06 #3

ok That makes sense. I'm obviously approaching this the wrong way.
Here's the background:

When the user selects to perform a long operation, I want to display a
temp page that says something like "Please wait while we process your
request," then go to the results when done.

So my idea was:
1. When user selects this option, Redirect to a page process.aspx that
has the "Please Wait" message.
2. Page_Load() for process.aspx first performs the long operation, then
when done Redirects to the results.aspx.

But of course this isn't working for the reasons you've explained.
Presumably there is a more effective way to achieve this effect?
dp

darrel wrote:
However the browser doesn't draw the contents of the page until after
Page_Load() is complete, though I wish it would.

The browser draws the page once it receives all the HTML.
Am I putting my operation in the wrong place? Where do I put a process
that I want run immediately after the page is first completely shown?

Once the page is completely shown, it's done with the server. The
transaction is complete. By the time your browser starts getting the HTML,
all your code has already been completely executed server-side.
Oct 9 '06 #4

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

Similar topics

1
by: WFB | last post by:
Hi, I have a base class from which all of my pages derive (ABCBasePage). For example, ABCCustomerSelect Inherits ABCPasePage. I would now like to have ABCPocketSelect which should inherit from...
6
by: martin | last post by:
Hi, I am a web page and a web user control. My web user control is placed in my web page using the following directive <%@ Register TagPrefix="uc1" TagName="Header"...
2
by: Olav Tollefsen | last post by:
I have a web form which does some time consuming operation (~ 10 seconds) in Page_Load. This results in a stale window to the user until Page_Load is finished rendering the page. Is it possible...
2
by: Pete | last post by:
Hi all... I sincerly hope one of the MS guys can clear this up for me... First some background... Ok, I have a web site which is fully translatable into several languages. All the strings...
6
by: MooreSmnith | last post by:
When I navigate to the next page using Response.Rediect("MyNextPage.aspx") current page Page_Load event is called. What I may wrongly understood is that post back will happen whenever there is any...
5
by: tshad | last post by:
Is there a way to carry data that I have already read from the datagrid from page to page? I am looking at my Datagrid that I page through and when the user says get the next page, I have to go...
7
by: UJ | last post by:
I've got a page with a user control on it. While the page is loading, it needs to check certain conditions of the user object to enable/disable things on the screen. Currently in the page_load of...
0
by: Managed Code | last post by:
Hello All, Here is my issue and thanks in advance for any assistance. I have a base page with a dropdownlist that fires an event with the selected index. The content page catches the event and...
0
by: benfly08 | last post by:
Hi, guys. I have a program to draw bar/pie chart based on the data i hard coded in it. However, my image comes with "BLACK" background color. I don't know how to fix this. The code snippet is...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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,...
0
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...
0
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...
0
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...

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.