Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net Building Controls (http://www.velocityreviews.com/forums/f59-asp-net-building-controls.html)
-   -   Web User Control with CustomValidation and Javascript (http://www.velocityreviews.com/forums/t759012-web-user-control-with-customvalidation-and-javascript.html)

Craig Buchanan 08-18-2008 09:54 PM

Web User Control with CustomValidation and Javascript
 
I have a Web User Control (.ascx file) that I need to valid using a
CustomValidation control. Moreover, I would like use client and server
validation, if possible. I have the logic for the server-side validation
working correctly. I also have the have the client-side validation working
once the control is embedded in a page. I would like to move the validation
from the aspx page to the ascx page, but I'm concerned that the
GetElementById() method will have an issue.

A couple of questions:
* can I build Javascript coding into the ascx page in a way that it will
work correctly however the control is embedded?
* can I switch between server and client validation programmatically,
meaning disable on mechanism and enable another?

Any thoughts would be appreciated. Thank you.

Craig buchanan



Peter Bucher [MVP] 09-10-2008 11:29 AM

Re: Web User Control with CustomValidation and Javascript
 
Hi Craig

> GetElementById() method will have an issue.

What kind of issues?

> A couple of questions:
> * can I build Javascript coding into the ascx page in a way that it will
> work correctly however the control is embedded?

Yes of course

> * can I switch between server and client validation programmatically,
> meaning disable on mechanism and enable another?

Yes

--
Gruss, Peter Bucher
Microsoft MVP - Visual Developer ASP / ASP.NET, Switzerland
http://www.aspnetzone.de/ - ASP.NET Zone, die ASP.NET Community
http://www.aspnetzone.de/blogs/peterbucher/ - Auf den Spuren von .NET



All times are GMT. The time now is 01:53 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.