Custom validation

M

Morten

Hi!

I've been experimenting with server side custom validation and I can't make
it work.

I have a text box which I'd like to validate by sending the content to a web
service which will check it and return 0 or 1. I've added a custom validator
control in VS .Net 2003. The code looks like this:

<asp:CustomValidator id="CustomValidator1" runat="server"
ControlToValidate="CVRNummer" ErrorMessage="TEST"></asp:CustomValidator>

By double-clicking the control the follwoing was added in the code-behind
file:

private void CustomValidator1_ServerValidate(object source,
System.Web.UI.WebControls.ServerValidateEventArgs args)
{
}

I've tried to add all sorts of things to this Sub to make something happen
but so far nothing has worked. My last attempt was this:

private void CustomValidator1_ServerValidate(object source,
System.Web.UI.WebControls.ServerValidateEventArgs args)
{
Label3.Text = "TEST";
}

which unfortunately didn't give me the expected result. Can someone help me
out here?

Best regards

Morten
 

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

Similar Threads

Problem with custom validation 3
Custom Validation Cntrl 5
custom validation 14
checkbox validation 1
Custom Validator 3
Custom validation 4
Help with CustomValidator in 1.1 1
Custom validation For validating dates 1

Members online

Forum statistics

Threads
473,982
Messages
2,570,185
Members
46,736
Latest member
AdolphBig6

Latest Threads

Top