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

Validator

Scheduled Pinned Locked Moved ASP.NET
questionhelp
6 Posts 3 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.
  • D Offline
    D Offline
    desmondling78
    wrote on last edited by
    #1

    Hi, I am looking for suggestions on validation on a page and usercontrol. I have a webpage test.aspx and a use control UserControl.ascx. Test.aspx txtName (textbox) rfvCheckName (RequiredFieldValidator to check txtName) btnSubmitName (button) UserControl.ascx txtTel (textbox) rfvCheckTel (RequiredFieldValidator to check txtTel) btnSubmitTel (button) Now, the required RequiredFieldValidator (RFV) works fine for the aspx and ascx. However, When I add the usercontrol into the test.aspx, a problem occurs: txtName (test.aspx) is empty txtTel (usercontrol.ascx) has input, When I click on the btnSubmitTel (usercontrol.ascx), it activates the rfvCheckName (test.aspx)! How can I force each button to activate only certain RFV? (If its possible at all) Or is there any work around to this? Thanks

    R 1 Reply Last reply
    0
    • D desmondling78

      Hi, I am looking for suggestions on validation on a page and usercontrol. I have a webpage test.aspx and a use control UserControl.ascx. Test.aspx txtName (textbox) rfvCheckName (RequiredFieldValidator to check txtName) btnSubmitName (button) UserControl.ascx txtTel (textbox) rfvCheckTel (RequiredFieldValidator to check txtTel) btnSubmitTel (button) Now, the required RequiredFieldValidator (RFV) works fine for the aspx and ascx. However, When I add the usercontrol into the test.aspx, a problem occurs: txtName (test.aspx) is empty txtTel (usercontrol.ascx) has input, When I click on the btnSubmitTel (usercontrol.ascx), it activates the rfvCheckName (test.aspx)! How can I force each button to activate only certain RFV? (If its possible at all) Or is there any work around to this? Thanks

      R Offline
      R Offline
      Ritesh1234
      wrote on last edited by
      #2

      Hi, You can not activate the certain Validator on click of button but u can set CauseValidation property of button to False to by pass the Validation.... Regards, Ritesh

      D 1 Reply Last reply
      0
      • R Ritesh1234

        Hi, You can not activate the certain Validator on click of button but u can set CauseValidation property of button to False to by pass the Validation.... Regards, Ritesh

        D Offline
        D Offline
        desmondling78
        wrote on last edited by
        #3

        Hi, I know and tried that. But the problem is that if I set the CauseValidation of the UserControl's button to false, then it won't activate the RFV inside the usercontrol. Dilemma!

        H 1 Reply Last reply
        0
        • D desmondling78

          Hi, I know and tried that. But the problem is that if I set the CauseValidation of the UserControl's button to false, then it won't activate the RFV inside the usercontrol. Dilemma!

          H Offline
          H Offline
          HimaBindu Vejella
          wrote on last edited by
          #4

          Then Why don't u go for java script instead of using Validation Controls! "Every morning I check Forbes 40 richest Indians list , if i'm not there I go to work."

          D 1 Reply Last reply
          0
          • H HimaBindu Vejella

            Then Why don't u go for java script instead of using Validation Controls! "Every morning I check Forbes 40 richest Indians list , if i'm not there I go to work."

            D Offline
            D Offline
            desmondling78
            wrote on last edited by
            #5

            is that the only way out?

            H 1 Reply Last reply
            0
            • D desmondling78

              is that the only way out?

              H Offline
              H Offline
              HimaBindu Vejella
              wrote on last edited by
              #6

              If u want to use only validation controls and doesn't want to use Javascript then u can do that using Frame work 2.0 It's a limitation in 1.1 since validation groups are not available in 1.1 "Every morning I check Forbes 40 richest Indians list , if i'm not there I go to work."

              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