Solved

RequiredFieldValidator Dynamic

Posted on 2008-10-30
10
367 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
Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

 
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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

I have developed many web applications with asp & asp.net and to add and use a dropdownlist was always a very simple task, but with the new asp.net, setting the value is a bit tricky and its not similar to the old traditional method. So in this a…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …

813 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now