Web User Control with CustomValidation and Javascript

Discussion in 'ASP .Net Web Controls' 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. Advertisements

  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. Advertisements

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:
    935
    Peter Blum
    Dec 22, 2004
  2. Reny J Joseph Thuthikattu
    Replies:
    1
    Views:
    819
    =?Utf-8?B?UHJha2FzaC5ORVQ=?=
    Dec 30, 2004
  3. gane kol
    Replies:
    3
    Views:
    7,414
    William F. Robertson, Jr.
    Apr 15, 2005
  4. ABC
    Replies:
    1
    Views:
    2,833
    Larry
    Oct 4, 2005
  5. ABC
    Replies:
    0
    Views:
    613
  6. =?Utf-8?B?Ym9iYnk=?=

    CustomValidation Control

    =?Utf-8?B?Ym9iYnk=?=, Sep 12, 2007, in forum: ASP .Net
    Replies:
    1
    Views:
    426
    =?Utf-8?B?TGFkaXNsYXYgTXJua2E=?=
    Sep 13, 2007
  7. Craig Buchanan
    Replies:
    1
    Views:
    453
    Peter Bucher [MVP]
    Sep 10, 2008
  8. Craig Buchanan

    Web User Control with CustomValidation and Javascript

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