Stopping a bubble event

D

David

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top