Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Checking too see if client side validation functions will be sent to the browser

Reply
Thread Tools

Checking too see if client side validation functions will be sent to the browser

 
 
Darrel
Guest
Posts: n/a
 
      07-09-2004
I am creating a server control that inherits from a command button.
The problem is it needs to generate different client side script,
depending on whether validators will get added to the page or not. On
the server side, is there some way I can check to see if the asp.net
page will be sending to the client the validation client side script
or not. Currenly I have to loop through every control on the page to
see if any of them is a validator. (A way that seems very inefficent.)
Is there a better way? I want to able to say, if any client side
validation will be done do this, otherwise do this.
 
Reply With Quote
 
 
 
 
Sergey Poberezovskiy
Guest
Posts: n/a
 
      07-10-2004
Darrel,

you could check Page.Validators collection to see how many
validators are on the page.

And whether the validation code is appended to the output -
I believe that validation script is generated only for
IE - so checking the Request.Browser.Type.StartsWith("IE")
will get you the rest.

Hope this helps.


>-----Original Message-----
>I am creating a server control that inherits from a

command button.
>The problem is it needs to generate different client side

script,
>depending on whether validators will get added to the

page or not. On
>the server side, is there some way I can check to see if

the asp.net
>page will be sending to the client the validation client

side script
>or not. Currenly I have to loop through every control on

the page to
>see if any of them is a validator. (A way that seems very

inefficent.)
> Is there a better way? I want to able to say, if any

client side
>validation will be done do this, otherwise do this.
>.
>

 
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
How to execute client-side code _after_ client-side validation? Bogdan ASP .Net 2 06-09-2008 01:31 PM
Client side script after client side validation with asp.net 2.0 Boss302 ASP .Net 0 11-21-2006 08:43 AM
Using both server side validation and client side validation =?Utf-8?B?dmlkeWE=?= ASP .Net 1 06-02-2005 09:45 PM
ASP.NET Web Forms Validation Controls are Server-Side or Client-Side Validation? Matt ASP .Net 14 01-30-2004 09:15 AM
validation summary doesnt display when there's client-side validation Libs ASP .Net 0 06-25-2003 03:05 PM



Advertisments