473,748 Members | 2,320 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1620
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
6957
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 ABCCustomerSelect. My problem is that when ABCPocketSelect is loaded the Page_Load event in ABCBasePage is called, followed by the load event for ABCCustomerSelect - and I would like to skip the ABCCustomerSelect load event.. My basic code is...
6
11298
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" Src="WebControls/Header.ascx" %> The web user control contains the following server controls
2
1116
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 to get the window to be drawn at once to the user, maybe displaying "Loading..." and then redraw the window again when the processing is complete? Olav
2
3376
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 for the web site are held in a database and all the labels, buttons etc are populated at run time in the Page_Load handler. The retreval of the strings from the database is all
6
2956
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 server side event happens, resulting in Page_load event. Page_Load is also happening when I navigate to the next page. That means Page_load will always happen when I navigate to the next page. Please correct me If I have totally misunderstood...
5
2791
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 to the database to get the next page. Is there a way to use the dataset to allow us to read back and forth in it instead of going back to the database to get it? Thanks,
7
23351
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 the user control I do things like read from the database on the first load, set some internal variables, ... If I need those things to be available to me on the page load, should I do them on page_init? Are there any ramifications of using...
0
2115
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 sets a connection string to the database. The content page has a simple gridview that should show records from the selected database. Initial content page displays data from correct place. first change of dropdownlist correctly updates content...
0
2881
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 below: chartGenerator.vb class: Imports System.Drawing.Imaging Public Class chartGenerator Private myImage As Bitmap
0
8983
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8822
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
9528
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...
1
9310
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
8235
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...
1
6792
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6072
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();...
1
3298
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2206
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.