Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 418
  • Last Modified:

RequiredFieldValidator Dynamic

I am setting the requiredfieldvalidator to dynamic, yet it is still leaving a gap under the text box. Isn't it supposed to not leave a line for the validator when dynamic? And open it up only when it needs to display?

<td>
textbox goes here
</br>
                        <asp:RequiredFieldValidator ID="valLastName" runat="server" Display="Dynamic"></asp:RequiredFieldValidator>
</td>
0
Starr Duskk
Asked:
Starr Duskk
  • 6
  • 4
1 Solution
 
silemoneCommented:
where do you want your validator to show the mess?  i don't see a message...I would suggest you put the <asp:RequiredFieldValidator in a <div> or <span>  that way when empty, it will collapse...
0
 
silemoneCommented:
mess is short for message, by the way
0
 
Starr DuskkASP.NET VB.NET DeveloperAuthor Commented:
I define my message in the codebehind.
 
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
Starr DuskkASP.NET VB.NET DeveloperAuthor Commented:
No, wrapping it in a <div> still displays the blank line where the validator is.
 
0
 
silemoneCommented:
there's going to be a blank line because of the <br />
0
 
Starr DuskkASP.NET VB.NET DeveloperAuthor Commented:
How do I get the validator to fall on the second line if there is no br?
 
0
 
silemoneCommented:
place in div
0
 
silemoneCommented:
<div> <asp:RequiredFieldValidator ID="valLastName" runat="server" Display="Dynamic"></asp:RequiredFieldValidator>
</div>

This way if empty, it collapses...if not, it starts on the next line.
0
 
Starr DuskkASP.NET VB.NET DeveloperAuthor Commented:
I guess that's what you've been trying to tell me.
thanks!
 
0
 
silemoneCommented:
oops...sorry if i wasn't clear in the beginning...but happy in the end the issue was resolved.
0

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

  • 6
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now