Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Building Controls > clienside validation for user controls

Reply
Thread Tools

clienside validation for user controls

 
 
cplatzer@solus-software.de
Guest
Posts: n/a
 
      11-29-2005
Hi,
I have created a custom control that represents a date-input. It
consists of a textbox and a button which opens a popup calendar.
Now when I have two of those date-inputs, I want to ensure that the
user doesn't enter a date in the second input that is smaller than that
in the first. I am using a comparevalidator to compare these two user
controls.
I have added a property called Text which returns the tex-property of
it's textbox and I have set <ValidationPropertyAttribute("Text")> in
the class-Definition.
However the validation only works server-side.
I have read somewhere (sadly I don't find the text anymore) that
clientside validation is only possible for controls that render their
value on the html-page (which my control does since it's value is the
value of a textbox ). However, the text didn't tell me how to tell the
validator that it can do clientside validation with my control.

Does anybody know how to do that?

Thanks in advance,
Christian

 
Reply With Quote
 
 
 
 
cplatzer@solus-software.de
Guest
Posts: n/a
 
      11-29-2005
I just noticed that my problem seems to be even bigger:

The server-side validation doesn't really work either:
When I enter wrong dates and then do a postback the message of the
validator is shown BUT I can still press any button on the page and
they still work like no error was present.

I don't have any problems with validators that directly validate
textboxes, thoug...

 
Reply With Quote
 
 
 
 
Santhi Maadhaven
Guest
Posts: n/a
 
      12-01-2005
cplatzer,
With Validator we wont be able to do client side script. Add th
script event to the server control like
srvContrlname.Attributes.Add("onClick","javascript :Test();");

"(E-Mail Removed)" wrote:

> Hi,
> I have created a custom control that represents a date-input. It
> consists of a textbox and a button which opens a popup calendar.
> Now when I have two of those date-inputs, I want to ensure that the
> user doesn't enter a date in the second input that is smaller than that
> in the first. I am using a comparevalidator to compare these two user
> controls.
> I have added a property called Text which returns the tex-property of
> it's textbox and I have set <ValidationPropertyAttribute("Text")> in
> the class-Definition.
> However the validation only works server-side.
> I have read somewhere (sadly I don't find the text anymore) that
> clientside validation is only possible for controls that render their
> value on the html-page (which my control does since it's value is the
> value of a textbox ). However, the text didn't tell me how to tell the
> validator that it can do clientside validation with my control.
>
> Does anybody know how to do that?
>
> Thanks in advance,
> Christian
>
>

 
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
where is the validation occurs for validation controls baroque Chou ASP .Net 4 01-24-2006 03:32 PM
using javascript in User controls to access server controls of the user control Faizan Ahmed ASP .Net Building Controls 1 01-04-2005 04:09 PM
using javascript in User controls to access server controls of the user control Faizan Ahmed ASP .Net Web Controls 1 01-04-2005 04:09 PM
Page appears to fail validation even though it has no validation controls =?Utf-8?B?ZGh1cndpdHo=?= ASP .Net 1 04-10-2004 07:37 AM
ASP.NET Web Forms Validation Controls are Server-Side or Client-Side Validation? Matt ASP .Net 14 01-30-2004 09:15 AM



Advertisments