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. Problem with RequiredFieldValidator

Problem with RequiredFieldValidator

Scheduled Pinned Locked Moved ASP.NET
helpquestion
7 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.
  • A Offline
    A Offline
    Aizupis
    wrote on last edited by
    #1

    Situation: In may Web page I have RequiredFieldValidators. I have button Back. I need that when I push the Back button, page redirects to other page (Response.Redirect("URL")). But its don't work, because of RequiredFieldValidators. I tried: ReqNAME.Enabled = False, but it's doesn't work too...:-(( But when I Disable this validator at all, not in scripting progress in Button_Clik event, its works.... Why it is so? I tried with Button_Click change other validator Properties, no reactions... ?

    P T 2 Replies Last reply
    0
    • A Aizupis

      Situation: In may Web page I have RequiredFieldValidators. I have button Back. I need that when I push the Back button, page redirects to other page (Response.Redirect("URL")). But its don't work, because of RequiredFieldValidators. I tried: ReqNAME.Enabled = False, but it's doesn't work too...:-(( But when I Disable this validator at all, not in scripting progress in Button_Clik event, its works.... Why it is so? I tried with Button_Click change other validator Properties, no reactions... ?

      P Offline
      P Offline
      peterzorbas
      wrote on last edited by
      #2

      check your asp html file and state itemCommand="resetControl()" as a function you define in your server side code and reset the controls.

      A 1 Reply Last reply
      0
      • P peterzorbas

        check your asp html file and state itemCommand="resetControl()" as a function you define in your server side code and reset the controls.

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

        I'm sorry - I'm a beginner in ASP.NET... Therefore I didn't understood where I must put itemCommand = resetControl()". Can U explain me, please?

        1 Reply Last reply
        0
        • A Aizupis

          Situation: In may Web page I have RequiredFieldValidators. I have button Back. I need that when I push the Back button, page redirects to other page (Response.Redirect("URL")). But its don't work, because of RequiredFieldValidators. I tried: ReqNAME.Enabled = False, but it's doesn't work too...:-(( But when I Disable this validator at all, not in scripting progress in Button_Clik event, its works.... Why it is so? I tried with Button_Click change other validator Properties, no reactions... ?

          T Offline
          T Offline
          Thea Burger
          wrote on last edited by
          #4

          Have you tried setting the Back buttons CausesValidation property to false? Is it a server control or an html control?

          A 1 Reply Last reply
          0
          • T Thea Burger

            Have you tried setting the Back buttons CausesValidation property to false? Is it a server control or an html control?

            A Offline
            A Offline
            Aizupis
            wrote on last edited by
            #5

            Thanx! It helps - but why it is so, why I couldn't change validation propertie Enabled to false, using VB.NET? :-( BTW - I use different way (before U solve my problem) - I drop Validations and use Labels with checkin If .. Then... :-) Bt there were many If, so Your solution is better... :-)) Thanx again.

            T 1 Reply Last reply
            0
            • A Aizupis

              Thanx! It helps - but why it is so, why I couldn't change validation propertie Enabled to false, using VB.NET? :-( BTW - I use different way (before U solve my problem) - I drop Validations and use Labels with checkin If .. Then... :-) Bt there were many If, so Your solution is better... :-)) Thanx again.

              T Offline
              T Offline
              Thea Burger
              wrote on last edited by
              #6

              Glad I could help. If I understand correctly you tried to disable the validation controls in your Back button's click event? This won't work, as validation takes place before this event fires, and your reqNAME.Enabled = False line of code will never be reached. You can disable them in Page_Load, this happens before validation. -Thea-

              A 1 Reply Last reply
              0
              • T Thea Burger

                Glad I could help. If I understand correctly you tried to disable the validation controls in your Back button's click event? This won't work, as validation takes place before this event fires, and your reqNAME.Enabled = False line of code will never be reached. You can disable them in Page_Load, this happens before validation. -Thea-

                A Offline
                A Offline
                Aizupis
                wrote on last edited by
                #7

                i though so..... I wanted do this using Page Load or Refresh, but decided, that it wouldn't be effective...

                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