473,564 Members | 2,768 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Canceling Subsequent events from page_load

How can I prevent subsequent events from firing when I have an error in the
page_load event?

Nov 19 '05 #1
4 1183
Can you elaborate? What do you want to happen? WHat should be rendered to
the client?

-Brock
DevelopMentor
http://staff.develop.com/ballen
How can I prevent subsequent events from firing when I have an error
in the page_load event?

Nov 19 '05 #2
This is when there is a postback. a command button is clicked, the page_load
event catches an error and produces an error message and sets the
errorlabel.visi ble to true and then exits the sub. At that point I want to
render the page. But right now it continues on to the command button
handler.

"Brock Allen" <ba****@NOSPAMd evelop.com> wrote in message
news:b8******** *************** ***@msnews.micr osoft.com...
Can you elaborate? What do you want to happen? WHat should be rendered to
the client?

-Brock
DevelopMentor
http://staff.develop.com/ballen
How can I prevent subsequent events from firing when I have an error
in the page_load event?


Nov 19 '05 #3
You can keep a boolean field in your page that is set in the Load event and
then checked in the Button command event. The other idea might to simply
check the error Label's Visible bit (instead of kepping a seperate boolean
on the page).

-Brock
DevelopMentor
http://staff.develop.com/ballen
This is when there is a postback. a command button is clicked, the
page_load event catches an error and produces an error message and
sets the errorlabel.visi ble to true and then exits the sub. At that
point I want to render the page. But right now it continues on to the
command button handler.

"Brock Allen" <ba****@NOSPAMd evelop.com> wrote in message
news:b8******** *************** ***@msnews.micr osoft.com...
Can you elaborate? What do you want to happen? WHat should be
rendered to the client?

-Brock
DevelopMentor
http://staff.develop.com/ballen
How can I prevent subsequent events from firing when I have an error
in the page_load event?

Nov 19 '05 #4
Thank you
"Brock Allen" <ba****@NOSPAMd evelop.com> wrote in message
news:b8******** *************** ***@msnews.micr osoft.com...
You can keep a boolean field in your page that is set in the Load event
and then checked in the Button command event. The other idea might to
simply check the error Label's Visible bit (instead of kepping a seperate
boolean on the page).

-Brock
DevelopMentor
http://staff.develop.com/ballen
This is when there is a postback. a command button is clicked, the
page_load event catches an error and produces an error message and
sets the errorlabel.visi ble to true and then exits the sub. At that
point I want to render the page. But right now it continues on to the
command button handler.

"Brock Allen" <ba****@NOSPAMd evelop.com> wrote in message
news:b8******** *************** ***@msnews.micr osoft.com...
Can you elaborate? What do you want to happen? WHat should be
rendered to the client?

-Brock
DevelopMentor
http://staff.develop.com/ballen
How can I prevent subsequent events from firing when I have an error
in the page_load event?


Nov 19 '05 #5

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

Similar topics

6
3804
by: V | last post by:
I have found that when I have a composite control that uses the CreateChildControls method, on a regular page load, Page_Load executes before CreateChildControls, but on a postback it is the reverse. This is causing logic problems and it really bothers me that this sequence of events fires inconsistently. Can anyone tell me why this happens...
3
2420
by: Kenton Smeltzer | last post by:
Hello All, I am having a problem with events and the addition of controls on a page I am developing. First let me tell you what I have tried and then maybe someone can see something I missed. First I tried adding the controls and the event handlers for my control in the Initialize Components method of my page in the hopes that it would...
3
2285
by: Mike | last post by:
Hi, I am adding controls dynamically in a WebForm, but none of these controls' events fire. Here is the class code I am using. I have tried so many things, but nothing works :-( namespace WebApplication1 { using System;
4
1160
by: Mohammed AlQuraishi | last post by:
Hi, I'm having trouble with synchronizing the order of server-side events, and I was hoping someone here can shed some light on what's happening. In a simplified version, I click on a button which changes the contents of a textbox, something like: private void btn_Click(object sender, System.EventArgs e) { TextBox1.Text = "I've changed";
1
1348
by: AT | last post by:
I have an aspx page with this code behind Public Class WebForm1 Inherits Class1 Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load ' Derived Return End Sub
5
1760
by: Paal Berggreen | last post by:
I am involved with development of a Portal solution using ASP.NET 2.0 and WebParts. The WebParts framework use the default personalization providers, and the personalization data thus ends up in the aspnetdb database (which we have placed on a proper SQL Server, not SQL Server Express). Everything works like a charm, with the following...
6
1732
by: Steve Hershoff | last post by:
Hi everyone, I've got a strange one here. There are two datagrids on my page, one nested within the other. I'll refer to them as the topmost and secondary datagrids. In the topmost datagrid's OnItemDataBound() method we check for the row in which it's appropriate to add the secondary datagrid. Exactly one row in the topmost grid will...
1
1891
by: Dom | last post by:
I selectively "disable" certain items in a ListBox. They appear gray and italicized. I want to make sure the user never selects these. Is there a way I can do this? For example, can I capture "SelectedItemChanged" and simply cancel it so that there will no subsequent call to DrawItem? Dom
25
5146
bugboy
by: bugboy | last post by:
I'm trying to find a cross browser solution for editing text in a flickr photo caption manor where the text is displayed in a <div> or <a> tag but changes to a <textarea> via JS when clicked. There are two problems. 1. setting the focus on the new textarea 2. keeping the new text value when switching back to normal text. Firefox: focuses...
0
7583
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...
0
7888
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. ...
0
8106
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...
1
7642
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...
0
7950
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...
1
5484
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...
0
3643
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...
1
2082
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
1
1200
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.