Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Restrict Validation

Restrict Validation

Scheduled Pinned Locked Moved ASP.NET
tutorialquestion
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    anada8886
    wrote on last edited by
    #1

    How to restrict the validation-controls, to fire the validation only on the click of a particular button. I am having 2 buttons on the page in 2 different panels(say,button1 in panel1 & button2 in panel2). Both are set as defaultButtons on each panels. Only 1 panel(panel2) is having validation controls. But suppose if I am using panel1 ,on the click of Enter,it should not check the validations in panel2 rather it should perform the button1_click(). How can I achieve this. Kindly Give some advice. Thank you.

    B 1 Reply Last reply
    0
    • A anada8886

      How to restrict the validation-controls, to fire the validation only on the click of a particular button. I am having 2 buttons on the page in 2 different panels(say,button1 in panel1 & button2 in panel2). Both are set as defaultButtons on each panels. Only 1 panel(panel2) is having validation controls. But suppose if I am using panel1 ,on the click of Enter,it should not check the validations in panel2 rather it should perform the button1_click(). How can I achieve this. Kindly Give some advice. Thank you.

      B Offline
      B Offline
      Brij
      wrote on last edited by
      #2

      You can do one thing, Just collect the validation controls from the panel1 assign them to a group( there is property of each validator control "ValidationGroup" and give a value to it) and then set the property "ValidationGroup",set it with the name of the group that you made of the button in panel1. Do similarly for Panel2. It'll solve your problem.If any issue please let me know :)

      Cheers!! Brij

      A 1 Reply Last reply
      0
      • B Brij

        You can do one thing, Just collect the validation controls from the panel1 assign them to a group( there is property of each validator control "ValidationGroup" and give a value to it) and then set the property "ValidationGroup",set it with the name of the group that you made of the button in panel1. Do similarly for Panel2. It'll solve your problem.If any issue please let me know :)

        Cheers!! Brij

        A Offline
        A Offline
        anada8886
        wrote on last edited by
        #3

        Hey,Thanx for your reply but,its not working.I am still getting those validation errors.I might have done something wrong. What I did was, I assigned a common name to the ValidationGroup property of the button & all the validation controls in 1 panel.But it dint work.It is still showing me all error messages on pressing Enter Key. One more thing, I am having a reCaptcha in 2nd panel,with other validators. Along with the validators this reCaptcha is also checked on client side & this is not among the Data Validators provided by .net. So,how can I deal with this reCaptcha even after changing the settings for the rest of the validators. Kindly guide.

        B 1 Reply Last reply
        0
        • A anada8886

          Hey,Thanx for your reply but,its not working.I am still getting those validation errors.I might have done something wrong. What I did was, I assigned a common name to the ValidationGroup property of the button & all the validation controls in 1 panel.But it dint work.It is still showing me all error messages on pressing Enter Key. One more thing, I am having a reCaptcha in 2nd panel,with other validators. Along with the validators this reCaptcha is also checked on client side & this is not among the Data Validators provided by .net. So,how can I deal with this reCaptcha even after changing the settings for the rest of the validators. Kindly guide.

          B Offline
          B Offline
          Brij
          wrote on last edited by
          #4

          anada8886 wrote:

          I might have done something wrong. What I did was, I assigned a common name to the ValidationGroup property of the button & all the validation controls in 1 panel.But it dint work.It is still showing me all error messages on pressing Enter Key.

          You must given different group name to panel2 controls?Do the same for both panel. and on enter whicn is getting clicked.If still there are issues post you code here.Then I can try to identify the problem.

          Cheers!! Brij

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups