Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > CustomValidator

Reply
Thread Tools

CustomValidator

 
 
Jim Heavey
Guest
Posts: n/a
 
      12-02-2003
I have the following code to create a CustomValidator control in code:

'* Add Custom Validator
Dim cvl1 As New CustomValidator()
cvl1.ID = "cvlAddRating"
cvl1.Display = ValidatorDisplay.Dynamic
cvl1.ControlToValidate = "ddladdRating"
cvl1.ErrorMessage = "Must make a selection"
cvl1.EnableClientScript = "False"

Now I want to associate this control to the event for the "ServerValidate"
event. How do I do this. I thught maybe the following code was part of
the solution, but not all.

Dim it As New System.Web.UI.WebControls.ServerValidateEventHandl er
(AddressOf Me.ValidateDropDownSelection)

Am I headed in the right direction? How do I assign "it" to the control
(cvl1)?

 
Reply With Quote
 
 
 
 
Frank Oquendo
Guest
Posts: n/a
 
      12-02-2003
Jim Heavey wrote:

> Now I want to associate this control to the event for the
> "ServerValidate" event. How do I do this.


Just double click the control and start typing.

--
There are 10 kinds of people. Those who understand binary and those who
don't.

http://code.acadx.com
(Pull the pin to reply)


 
Reply With Quote
 
 
 
 
Jim Heavey
Guest
Posts: n/a
 
      12-02-2003
"Frank Oquendo" <(E-Mail Removed)> wrote in news:eqz7K6RuDHA.1596
@TK2MSFTNGP10.phx.gbl:

> Jim Heavey wrote:
>
>> Now I want to associate this control to the event for the
>> "ServerValidate" event. How do I do this.

>
> Just double click the control and start typing.
>


As my original note indicated, I am doing all of this in code, so there is
no object from me to double click on!
 
Reply With Quote
 
Frank Oquendo
Guest
Posts: n/a
 
      12-02-2003
Jim Heavey wrote:

> As my original note indicated, I am doing all of this in code, so
> there is no object from me to double click on!


So it did. My mistake. Try something like this:

this.CustomValidator1.ServerValidate +=
new ServerValidateEventHandler(CustomValidator1_Server Validate);

--
There are 10 kinds of people. Those who understand binary and those who
don't.

http://code.acadx.com
(Pull the pin to reply)


 
Reply With Quote
 
Jim Heavey
Guest
Posts: n/a
 
      12-03-2003

Thanks!!!!!!!!!
 
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
CustomValidator Delima OR Rendering the WebUIValidation Tag Art Kedroski ASP .Net 0 07-25-2003 11:25 PM
CustomValidator bug? George Ter-Saakov ASP .Net 2 07-22-2003 02:33 PM
CustomValidator controls George Ter-Saakov ASP .Net 0 07-21-2003 09:42 PM
CustomValidator limitation? Wayne MJ ASP .Net 0 07-21-2003 01:51 AM
Errormessage in CustomValidator Edmilson ASP .Net 0 07-10-2003 12:56 PM



Advertisments