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

Catching a RequiredFiled Validator event in PageLoad or some other event?

Hi!

If I use a RequiredField Validator to make sure a TextBox is filled by a
user and the user DOESN'T it triggers and shows the errortext of that
control.

I want more to happen on the page when that happens and is there an Event or
something I can check that it has been triggered?

Regards
/Lars
Nov 18 '05 #1
3 1003
I would guess your would need to create a Custom_Validator and not specify
the control to validate (that way it will run even when your TextBox is
empty).

Inside your Custom_Validator check to see if the TextBox was empty and act
on it.

Greg

"Lars Netzel" <[stop_spam]@host.topdomain> wrote in message
news:e0****************@TK2MSFTNGP10.phx.gbl...
Hi!

If I use a RequiredField Validator to make sure a TextBox is filled by a
user and the user DOESN'T it triggers and shows the errortext of that
control.

I want more to happen on the page when that happens and is there an Event or something I can check that it has been triggered?

Regards
/Lars

Nov 18 '05 #2
I believe you can use the IsValid property of the validator itself to
check this.

http://msdn.microsoft.com/library/en...ValidTopic.asp

Note that validation happens AFTER the Page_Load event, so if you get
this property in the Page_Load event, it will always return True,
since the control has not yet been validated. If you must check
validity in the Page_Load event, you can manually call the
Page.Validate method (or just call the Validate method of the
validator you want to check on).

http://msdn.microsoft.com/library/en...pplusvalid.asp
"Lars Netzel" <[stop_spam]@host.topdomain> wrote in message news:<e0**************@TK2MSFTNGP10.phx.gbl>...
If I use a RequiredField Validator to make sure a TextBox is filled by a
user and the user DOESN'T it triggers and shows the errortext of that
control.

I want more to happen on the page when that happens and is there an Event or
something I can check that it has been triggered?

Nov 18 '05 #3
BUT, if he has client-side validation turned on he may never get back to the
server to run anything.

Greg

"DujHoD" <J2********@aol.com> wrote in message
news:76**************************@posting.google.c om...
I believe you can use the IsValid property of the validator itself to
check this.

http://msdn.microsoft.com/library/en...ValidTopic.asp
Note that validation happens AFTER the Page_Load event, so if you get
this property in the Page_Load event, it will always return True,
since the control has not yet been validated. If you must check
validity in the Page_Load event, you can manually call the
Page.Validate method (or just call the Validate method of the
validator you want to check on).

http://msdn.microsoft.com/library/en...pplusvalid.asp
"Lars Netzel" <[stop_spam]@host.topdomain> wrote in message

news:<e0**************@TK2MSFTNGP10.phx.gbl>...
If I use a RequiredField Validator to make sure a TextBox is filled by a user and the user DOESN'T it triggers and shows the errortext of that
control.

I want more to happen on the page when that happens and is there an Event or something I can check that it has been triggered?

Nov 18 '05 #4

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

Similar topics

2
by: Dominic | last post by:
Hi guys, I'm not sure if this question belongs to FAQ, but I couldn't find a concrete answer. I created a Datagrid control using ItemTemplate, but it's NOT a in-place editing datagrid. One of...
1
by: dotnet beginner | last post by:
In my webform I check for dirty(textbox values changed), and pop up a confirm dialog box on an asp-Imagebutton click event. I wrote a javascript function (to pop up confirm box) and called it in...
2
by: Pham Nguyen | last post by:
Has anyone seen an example of a textbox server control that has built-in client-side validation? I'd like to build a server control that extends the System.Web.UI.WebControls.TextBox class to allow...
0
by: Bammer22 | last post by:
I have a from with a few webcontrols (all dropdownlists and one button) that is built dynamically during page load. The button is also built dynamically and its eventhandler is set during pageload...
0
by: Dan | last post by:
hi, i have a page with two usercontrols: 1. a static menu control. 2. a dynamically loaded control as user interface the main page receives events from the menu and sets the apropriate ui...
9
by: Marcelo Cabrera | last post by:
Hi, I have a user control that in turn creates a bunch of webcontrols dynamically and handles the events these webcontrols raise. It used to work fine on ASP .Net 1.1 but when compiled on 2.0 it...
6
by: Kevin Attard | last post by:
I am using a GridView inside a UserControl which has a template column for deleting the rows. Before databinding the gridview i am attaching the RowCommand and RowDataBound event. I am using the...
0
by: progman417 | last post by:
Hello, I've got a Web User Control containing a gridview with a "select record" button on each row. When the user clicks the button I want to call an event handler in the main page. My...
1
by: Forumtroll | last post by:
I have a Web User Control that parses an XML file and renders a Form based on the XML. The problem is that I create a button on the bottom of the form that will fire off a subscribeable event, but...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.