Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Catching a RequiredFiled Validator event in PageLoad or some other event?

Reply
Thread Tools

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

 
 
Lars Netzel
Guest
Posts: n/a
 
      07-22-2004
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


 
Reply With Quote
 
 
 
 
Greg Burns
Guest
Posts: n/a
 
      07-22-2004
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:e0E6yg%(E-Mail Removed)...
> 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
>
>



 
Reply With Quote
 
 
 
 
DujHoD
Guest
Posts: n/a
 
      07-22-2004
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:<e0E6yg#(E-Mail Removed)>...
> 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?

 
Reply With Quote
 
Greg Burns
Guest
Posts: n/a
 
      07-22-2004
BUT, if he has client-side validation turned on he may never get back to the
server to run anything.

Greg

"DujHoD" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) 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:<e0E6yg#(E-Mail Removed)>...
> > 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?



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
firing an event programatically after pageload sripathi ASP .Net 0 01-25-2010 11:47 AM
click on Hyperlink in a Frame loads page but no pageload event rai =?Utf-8?B?TmVhbA==?= ASP .Net 0 07-17-2006 01:06 PM
Discovering what event was raised in PageLoad Piotr ASP .Net Datagrid Control 0 01-09-2006 11:05 AM
pageLoad event on a frameset Eitan M ASP .Net 1 06-06-2005 07:46 PM
Caching and PageLoad event =?Utf-8?B?TWlrZQ==?= ASP .Net 2 09-24-2004 10:39 AM



Advertisments