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. How to trace which hidden control's validator is failing?

How to trace which hidden control's validator is failing?

Scheduled Pinned Locked Moved ASP.NET
csharpasp-netdesigndebugginghelp
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.
  • R Offline
    R Offline
    Rafferty Uy
    wrote on last edited by
    #1

    Hi, I have a huge page with around 10 custom controls which are shown/hidden depending on what the user chooses in certain drop-down lists. (Please don't ask why the design is like this). Now each of these controls have ASP.Net validators such as RequiredFieldValidator, CompareValidator, etc. Now I'm having a problem of tracing which validator failed if the parent control is hidden in the page (Visible = false;). Is there an easy way to test this? The only way I can think of is to change the code temporarily and show all the controls all the time just to actually see which one has the problem. But maybe there's a better way. Thanks in advance. Rafferty

    Rafferty

    B 1 Reply Last reply
    0
    • R Rafferty Uy

      Hi, I have a huge page with around 10 custom controls which are shown/hidden depending on what the user chooses in certain drop-down lists. (Please don't ask why the design is like this). Now each of these controls have ASP.Net validators such as RequiredFieldValidator, CompareValidator, etc. Now I'm having a problem of tracing which validator failed if the parent control is hidden in the page (Visible = false;). Is there an easy way to test this? The only way I can think of is to change the code temporarily and show all the controls all the time just to actually see which one has the problem. But maybe there's a better way. Thanks in advance. Rafferty

      Rafferty

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

      You can have better approach on this. You can create several validation group based on the dropdownlist value. And validate only the groups that are visible. So the validators in different group, would not be fired. Another way, you can enable and disable the validators based on the dropdown selection, as you must be what all validators you need to fire , according to dropdown value. You can have a look one of my article on ASP.NET validators. Exploring ASP.NET Validators

      Cheers!! Brij Visit my Blog: http://brijbhushan.net
      Check my latest Article :ViewState - Various ways to reduce performance overhead

      R 1 Reply Last reply
      0
      • B Brij

        You can have better approach on this. You can create several validation group based on the dropdownlist value. And validate only the groups that are visible. So the validators in different group, would not be fired. Another way, you can enable and disable the validators based on the dropdown selection, as you must be what all validators you need to fire , according to dropdown value. You can have a look one of my article on ASP.NET validators. Exploring ASP.NET Validators

        Cheers!! Brij Visit my Blog: http://brijbhushan.net
        Check my latest Article :ViewState - Various ways to reduce performance overhead

        R Offline
        R Offline
        Rafferty Uy
        wrote on last edited by
        #3

        Hi Brij! Thanks for the reply. That's a good idea... I think I'll do that for the newer pages. However, I don't have the budget to change the validation group of this page that we're tracing. Do you know of a quick (maybe dirty) way of tracing and knowing which validation control is failing? Thanks again.

        Rafferty

        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