Web User Control with CustomValidation and Javascript

Discussion in 'ASP .Net' started by Craig Buchanan, Aug 18, 2008.

  1. 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
     
    Craig Buchanan, Aug 18, 2008
    #1
    1. Advertising

  2. 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
     
    Peter Bucher [MVP], Sep 10, 2008
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. kpg
    Replies:
    2
    Views:
    777
    Peter Blum
    Dec 22, 2004
  2. gane kol
    Replies:
    3
    Views:
    7,110
    William F. Robertson, Jr.
    Apr 15, 2005
  3. =?Utf-8?B?Ym9iYnk=?=

    CustomValidation Control

    =?Utf-8?B?Ym9iYnk=?=, Sep 12, 2007, in forum: ASP .Net
    Replies:
    1
    Views:
    331
    =?Utf-8?B?TGFkaXNsYXYgTXJua2E=?=
    Sep 13, 2007
  4. Craig Buchanan

    Web User Control with CustomValidation and Javascript

    Craig Buchanan, Aug 18, 2008, in forum: ASP .Net Building Controls
    Replies:
    1
    Views:
    782
    Peter Bucher [MVP]
    Sep 10, 2008
  5. Craig Buchanan

    Web User Control with CustomValidation and Javascript

    Craig Buchanan, Aug 18, 2008, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    159
    Peter Bucher [MVP]
    Sep 10, 2008
Loading...

Share This Page