473,407 Members | 2,315 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,407 software developers and data experts.

Stopping a bubble event

Hi all,

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

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_Click(object sender, eventargs e)
{
MyDate = Convert.ToDateTime(<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 1786
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.page.

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_Click(object sender, eventargs e)
{
MyDate = Convert.ToDateTime(<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
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...
6
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...
5
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...
1
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...
6
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...
4
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...
6
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...
0
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
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...
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...
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
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...
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...
0
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,...
0
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...

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.