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. General Programming
  3. C#
  4. How to bypass Required FieldValidators using VS2003?

How to bypass Required FieldValidators using VS2003?

Scheduled Pinned Locked Moved C#
tutorialcsharpasp-netsysadminquestion
3 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.
  • G Offline
    G Offline
    Gaurav Aroraa
    wrote on last edited by
    #1

    Hi all! :laugh: I am facing problems while writting an Asp.net application in VS2003. Actually I have four text boxes on a web page everyone has its own requiredfiled validator and having two buttons on the same web form. Now, Whenever, I will hit either button the both validators will validate and the IsValid returns false. I want to validate only two validators by pressing buttons. Example: It will work like this, when I will press Button1 then only first two text boxes validate and other remains not validate and vis-a-versa. The following is snippet of my web page: <asp:TextBox ID="text1" runat="server" /> <asp:RequiredFieldValidator ID="rfv1" runat="server" ControlToValidate="text1" ErrorMessage="validate" /> <asp:TextBox ID="text2" runat="server" /> <asp:RequiredFieldValidator ID="rfv2" runat="server" ControlToValidate="text2" ErrorMessage="validate" /> <asp:TextBox ID="text3" runat="server" /> <asp:RequiredFieldValidator ID="rfv3" runat="server" ControlToValidate="text3" ErrorMessage="validate" /> <asp:Button id="button1" runat="server" OnClick="button1_Click" /> <asp:Button id="button2" runat="server" OnClick="button2_Click" /> Gaurav Arora

    S 1 Reply Last reply
    0
    • G Gaurav Aroraa

      Hi all! :laugh: I am facing problems while writting an Asp.net application in VS2003. Actually I have four text boxes on a web page everyone has its own requiredfiled validator and having two buttons on the same web form. Now, Whenever, I will hit either button the both validators will validate and the IsValid returns false. I want to validate only two validators by pressing buttons. Example: It will work like this, when I will press Button1 then only first two text boxes validate and other remains not validate and vis-a-versa. The following is snippet of my web page: <asp:TextBox ID="text1" runat="server" /> <asp:RequiredFieldValidator ID="rfv1" runat="server" ControlToValidate="text1" ErrorMessage="validate" /> <asp:TextBox ID="text2" runat="server" /> <asp:RequiredFieldValidator ID="rfv2" runat="server" ControlToValidate="text2" ErrorMessage="validate" /> <asp:TextBox ID="text3" runat="server" /> <asp:RequiredFieldValidator ID="rfv3" runat="server" ControlToValidate="text3" ErrorMessage="validate" /> <asp:Button id="button1" runat="server" OnClick="button1_Click" /> <asp:Button id="button2" runat="server" OnClick="button2_Click" /> Gaurav Arora

      S Offline
      S Offline
      ssg31415926
      wrote on last edited by
      #2

      Probably not much help but .NET 2.0 has the ValidationGroup property which allows you to do what you want. I think you have to resort to CustomValidators to get what you want but it's been a long time since I did anything .NET 1.1.

      G 1 Reply Last reply
      0
      • S ssg31415926

        Probably not much help but .NET 2.0 has the ValidationGroup property which allows you to do what you want. I think you have to resort to CustomValidators to get what you want but it's been a long time since I did anything .NET 1.1.

        G Offline
        G Offline
        Gaurav Aroraa
        wrote on last edited by
        #3

        Thanks for your attempt, I knew how to handle it in .NET2.0 but I want to do the same in .NET1.1, the requirement demanded so. I have to use Requirefieldvalidator not Custo,Validator. Thanks :laugh:

        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