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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. problem with asp:ValidationSummary-control

problem with asp:ValidationSummary-control

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

    Hello! I´ve got a number of validators on a page. I display the errormessages they generate in a ValidationSummary-control. I dont want the actual errormessage to show twice, so I´ve got property Display set to None on all the validators. Problem is this: Im in a textbox with a requiredfieldvalidator pointed at it. I press enter, and nothing happens. No error message in the summarycontrol, no nothing. If I remove the Display=None from the validator I get the errormessage, but only in the validator not in the summary. I´ve got EnableClientScript set to trueon my summarycontrol, shouldnt I get the errormessage there right away? Not I´ve got to press a button or something in order for the errormessage to show there.

    C 1 Reply Last reply
    0
    • L livez

      Hello! I´ve got a number of validators on a page. I display the errormessages they generate in a ValidationSummary-control. I dont want the actual errormessage to show twice, so I´ve got property Display set to None on all the validators. Problem is this: Im in a textbox with a requiredfieldvalidator pointed at it. I press enter, and nothing happens. No error message in the summarycontrol, no nothing. If I remove the Display=None from the validator I get the errormessage, but only in the validator not in the summary. I´ve got EnableClientScript set to trueon my summarycontrol, shouldnt I get the errormessage there right away? Not I´ve got to press a button or something in order for the errormessage to show there.

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      There's two properties ( text and error from memory ), and you can set one to blank and the other to the text for the summary. If you set only one, they both are teh same.

      Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

      L 1 Reply Last reply
      0
      • C Christian Graus

        There's two properties ( text and error from memory ), and you can set one to blank and the other to the text for the summary. If you set only one, they both are teh same.

        Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

        L Offline
        L Offline
        livez
        wrote on last edited by
        #3

        Thanks for your reply. But I don´t understand exactly what you mean. Does the Summary-control have two properties I need to set? This is what it looks like now:

                    runat="server" 
                    DisplayMode="List" 
                    ShowSummary="true" 
                    EnableClientScript="true" 
                    ShowMessageBox="false" 
                    HeaderText="yadayada>
        
        C 1 Reply Last reply
        0
        • L livez

          Thanks for your reply. But I don´t understand exactly what you mean. Does the Summary-control have two properties I need to set? This is what it looks like now:

                      runat="server" 
                      DisplayMode="List" 
                      ShowSummary="true" 
                      EnableClientScript="true" 
                      ShowMessageBox="false" 
                      HeaderText="yadayada>
          
          C Offline
          C Offline
          Christian Graus
          wrote on last edited by
          #4

          No, the validators do.

          Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

          L 1 Reply Last reply
          0
          • C Christian Graus

            No, the validators do.

            Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

            L Offline
            L Offline
            livez
            wrote on last edited by
            #5

            You mean Text and ErrorMessage? I´ve tried giving both value but the problem remains :( EDIT: I might add that the problem only occurs if I leave textbox blank. If I type in a few letters and press enter all the validators show correct messages in the summarycontrol.

            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