473,726 Members | 2,162 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Page load and event queue

Hi,

The system I am working on handles web page navigation in the following
fashion: When a button is clicked on a web page a post-back is
triggered. The page_load event occurs as usual with the the button
click event occurring afterwards. The button click event then runs the
code to forward the user to the next web page.

My problem is that the page_load event runs a whole load of code that
is unecessary when the button click event is about to forward the user
to another page.

I was hoping that someone could help me with this please? Is there an
event queue, or something similar, that can be examined to see if the
button click event has been raised? If there is, then the page_load
code could simply skip the unecessary code. If there isn't than I
imagine just passing a flag is the best way to skip the code.

Many thanks,
Steve

Nov 19 '05 #1
1 1922
if I have a case like this, I would normally move the code into the
PreRender event

if you do a redirect in the button click, the prerender won't ever be
called. Even if you don't do a redirect you can still set up a flag in the
button click and check that in the PreRender

there is another way which involves inspecting the request object (I can't
remember the exact details OTTOMH) but in this case I think my solution
would be cleaner

<st*********@gm ail.com> wrote in message
news:11******** *************@o 13g2000cwo.goog legroups.com...
Hi,

The system I am working on handles web page navigation in the following
fashion: When a button is clicked on a web page a post-back is
triggered. The page_load event occurs as usual with the the button
click event occurring afterwards. The button click event then runs the
code to forward the user to the next web page.

My problem is that the page_load event runs a whole load of code that
is unecessary when the button click event is about to forward the user
to another page.

I was hoping that someone could help me with this please? Is there an
event queue, or something similar, that can be examined to see if the
button click event has been raised? If there is, then the page_load
code could simply skip the unecessary code. If there isn't than I
imagine just passing a flag is the best way to skip the code.

Many thanks,
Steve

Nov 19 '05 #2

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

Similar topics

8
4206
by: Graeme Matthew | last post by:
Hi all I just cannot seem to find any documentation that shows an example of using the factory method Event() in threads. I have a thread pool and if there are no jobs in a Queue I want them to wait for something to be inserted. When a job is inserted I want to send an Event, the first thread that picks it up runs with the job the rest wait for another insert Event. I have been looking at some C, c++ implementations and some use a...
6
2877
by: Dan | last post by:
I've created a pocketpc app which has a startup form containing a listview. The form creates an object which in turn creates a System.Threading.Timer. It keeps track of the Timer state using a TimerState object similar to the example in the System.Threading.Timer documentation. The method which handles the timer events, among other things, periodically calls a method in this TimerState object which raises an event to the startup form,...
1
6956
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...
2
3626
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
1352
by: David Lozzi | last post by:
Howdy, I have a cancel button, I would like to send them to the previous page they were on. For example, they are viewing a queue of tickets. They can click on a ticket and update it if they wish, or view other information. When viewing some of the other details, the page is reloaded to show and hide some controls. If they click Cancel, I'd like to send them back to the queue. Normally, I would simply do a...
9
2471
by: jeff | last post by:
New VB user...developer... Situation...simplified... - I want to wrap a pre and post event around a system generated where the pre-event will always execute before the system event and the post event will always execuate after the system is completed... - I want to wrap this functionality in a framework, so I could possibly have 3 or 4 levels of inherited objects that need to have these pre / post events executed before and after the...
9
18027
by: RvGrah | last post by:
I'm completely new to using background threading, though I have downloaded and run through several samples and understood how they worked. My question is: I have an app whose primary form will almost always lead to the user opening a certain child window that's fairly resource intensive to load. Is it possible to load this form in a backgroundworker and then use the Show method and hide method as necessary? Anyone know of
3
21147
by: GauravGupta | last post by:
i want to know that is it posible to call button click event before page load event on post back.... please help me....
5
2305
by: nt5515 | last post by:
im trying to write a program that store a binary tree of possible events in an array. i need to be able to sort the the Events in the array based on the previous event that caused it by the time which they will occur. After the specific time has passed the event will be removed and all other events will be bumped up, all the while new events will be added to the end and sorted by their time. Please Help heres wot i've got so far, i've got...
0
8752
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
9402
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
9182
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
9120
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
8101
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
6702
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
6011
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
4521
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3228
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

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.