Solved

RequiredFieldValidator Dynamic

Posted on 2008-10-30
10
382 Views
Last Modified: 2012-05-05
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
Comment
Question by:Starr Duskk
  • 6
  • 4
10 Comments
 
LVL 21

Expert Comment

by:silemone
ID: 22844332
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
 
LVL 21

Expert Comment

by:silemone
ID: 22844336
mess is short for message, by the way
0
 
LVL 2

Author Comment

by:Starr Duskk
ID: 22844411
I define my message in the codebehind.
 
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 2

Author Comment

by:Starr Duskk
ID: 22844426
No, wrapping it in a <div> still displays the blank line where the validator is.
 
0
 
LVL 21

Expert Comment

by:silemone
ID: 22844466
there's going to be a blank line because of the <br />
0
 
LVL 2

Author Comment

by:Starr Duskk
ID: 22844644
How do I get the validator to fall on the second line if there is no br?
 
0
 
LVL 21

Expert Comment

by:silemone
ID: 22844848
place in div
0
 
LVL 21

Accepted Solution

by:
silemone earned 500 total points
ID: 22844865
<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
 
LVL 2

Author Comment

by:Starr Duskk
ID: 22845031
I guess that's what you've been trying to tell me.
thanks!
 
0
 
LVL 21

Expert Comment

by:silemone
ID: 22845044
oops...sorry if i wasn't clear in the beginning...but happy in the end the issue was resolved.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

735 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question