473,796 Members | 2,460 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Stopping a bubble event

Hi all,

I have a page that inherits from my own page class that inherits from
system.web.ui.p age.

In my page, I have a button click event that saves content of the page. The
saving is actually done via the bubbled event rather than directly in my
page.

Now, if I enter invalid data (for example, 31st February 2007), I need to
stop the event from bubbling and report the error to the user. The page
itself is converting the the date/time...

for example...

private void SaveButton_Clic k(object sender, eventargs e)
{
MyDate = Convert.ToDateT ime(<date/time to convert>);
}

MyDate is then sent up through the bubbling to be saved by my page class.
However, if 31 February 2007 is entered, it fails on that line (which I
expect). I can try/catch the exception and display onto the page, but how do
I stop the event from bubbling upwards and still trying to save an invalid
date (which will still fail)?

Thanks.
--
Best regards,
Dave Colliver.
http://www.AshfieldFOCUS.com
~~
http://www.FOCUSPortals.com - Local franchises available
Apr 26 '07 #1
1 1805
read the Validation documentation.

-- bruce (sqlwork.com)

David wrote:
Hi all,

I have a page that inherits from my own page class that inherits from
system.web.ui.p age.

In my page, I have a button click event that saves content of the page. The
saving is actually done via the bubbled event rather than directly in my
page.

Now, if I enter invalid data (for example, 31st February 2007), I need to
stop the event from bubbling and report the error to the user. The page
itself is converting the the date/time...

for example...

private void SaveButton_Clic k(object sender, eventargs e)
{
MyDate = Convert.ToDateT ime(<date/time to convert>);
}

MyDate is then sent up through the bubbling to be saved by my page class.
However, if 31 February 2007 is entered, it fails on that line (which I
expect). I can try/catch the exception and display onto the page, but how do
I stop the event from bubbling upwards and still trying to save an invalid
date (which will still fail)?

Thanks.
Apr 26 '07 #2

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

Similar topics

8
1994
by: saif | last post by:
Hi all, I realy need your help. I have a page with different web links, now what I am trying to do is whenever a user clicks on a link that link is captured using event.target method. I'm using this to process that URL, but the real part is stopping the document from loading that URL. I tried stop() method but its not working. I also tried asigning current URL of the document to the document's location but it failed to work.
6
5917
by: Dave | last post by:
I have a situation where I want to react to a ctrl-click on a <span> and it works in Netscape and Firefox browsers but in IE I have a problem. In IE I do catch the ctrl-click but IE also renders the span in inverse video, essentially selecting the item. Here is a short sample that demonstrates the issue: <html><head> <script type="text/javascript">
5
6835
by: Tom Gao | last post by:
Hello friends I'm trying to perform event bubble on a user control from the example on http://odetocode.com/Articles/94.aspx but this example doesn't work... when I run the code it says BubbleControl does not exist which makes sense as nothing was assigned to BubbleControl... I'm just curious if I should assign because I did try assigning BubbleControl with a new instance but still it did not assign the event to...
1
4374
by: Lucifer | last post by:
Hi I am trying to raise a bubble event. I have a dropdownlist and a datalist in a datalist. I want to use the postback from the dropdownlist to rebind the nested datalist. But i need the event to be a datalist Command so i have access to e.item for the main datalist
6
8122
by: D | last post by:
I have a simple file server utility that I wish to configure as a Windows service - using the examples of the Python Win32 book, I configured a class for the service, along with the main class functions __init__, SvcStop, and SvcDoRun (which contains my server code). After registering the service, I am able to start it with no problems. However, it never stops correctly (net stop returns "service could not be stopped") and service is left...
4
2043
by: bjm | last post by:
I am writing a program that will automate a series of application installations. I want to give the user the option of stopping the program's execution in between installations (for example, give the user the chance to stop the program after the second installation before it continues on to the third installation). However, I want the user to be able to start the installations and walk away as well, so I can't ask the user if he wants to...
6
2669
by: blaine | last post by:
Hello, I'm currently overriding function keys (F1 to F4) to perform other actions. In order to do this the default popup windows of Help (F1), Seach(F3) etc must be turned off. In FF it's easy enought to do using the preventDefault and stopPropagation event functions. IE's equivalent is supposed to be cancelBubble and returnValue, however I can not seem to get them to stop no matter what I try.
0
1072
by: shapper | last post by:
Hello, I have a few custom controls organized as follows: Parent Child Section User User control raises an event named Updated. This event has custom arguments of type UpdatedEventArgs.
2
3374
by: Steve | last post by:
Hi All, I've been trying to come up with a good way to run a certain process at a timed interval (say every 5 mins) using the SLEEP command and a semaphore flag. The basic thread loop was always sitting in the sleep command and not able to be interrupted. When the time came to set the semaphore flag to false (stopping the thread), my program would have to wait up to the entire sleep time to break out of the loop. I have finally found...
0
9529
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
10457
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
10231
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...
0
10013
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...
1
7550
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
6792
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
5576
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3733
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2927
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.