Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7795083
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T22:57:50+00:00 2026-06-01T22:57:50+00:00

hi im have a very common problem but unable to find any answer i

  • 0

hi im have a very common problem but unable to find any answer
i have a div and there are validator controls in it. I have used br tag in ErrorMessage Text to show show each message in new line. My code is below

    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" CssClass="lblMessageError"
        runat="server"  ErrorMessage="<br> User name field cannot be empty" ControlToValidate="txtUserName" SetFocusOnError="True"></asp:RequiredFieldValidator> 
    <asp:CustomValidator ID="CustomValidator1" runat="server" ClientValidationFunction="ClientValidate" ControlToValidate="txtPassword" CssClass="lblMessageError" ErrorMessage="<br />The password must be more than 6 characters."></asp:CustomValidator>  
    <asp:CompareValidator ID="CompareValidator1" runat="server" CssClass="lblMessageError" ControlToCompare="txtPassword" controlToValidate="txtRePassword" ErrorMessage="<br /> Password dont match with repassword"></asp:CompareValidator>  
</div>

when there is no error found then it show line breaks. all i want is when there is not error found line breaks are ommitted.

1) when all validators are hidden

‘<%–line Break because no error found–%>
‘<%–line Break because no error found–%>

‘ <%–line Breakbecause no error found—%>

2) when one validator is visible and other and hidden

User name field cannot be empty
‘ <%–line Break because no error found–%>
‘ <%–line Breakbecause no error found—%>

‘<%– ally my controls here–%>

and i also dont want to show all my errors in same line
any suggestions??

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T22:57:51+00:00Added an answer on June 1, 2026 at 10:57 pm

    Add the Display="Dynamic" attribute to your validator, eg:

     <asp:RequiredFieldValidator ID="RequiredFieldValidator1" CssClass="lblMessageError"
        runat="server"  Display="Dynamic" ErrorMessage="<br> User name field cannot be empty" ControlToValidate="txtUserName" SetFocusOnError="True"></asp:RequiredFieldValidator> 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

It seems a very common problem. But I couldn't find any working solution. We
I know that this is very common problem and I have gone through almost
I think I have what must be a very common problem to solve and
I have the very common problem of creating an index for an in-disk array
I know this is a pretty common problem but any of the solutions I
I have a common problem, and have looked at several solutions but haven't seen
I think this is a very common situation, but I can't find how everybody
I am sure this is a very very common problem. I have a struts
I have the following situation. There is some very common class in my application
OK this is a very common problem but mine is a bit different and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.