Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

why is asp:requiredfieldvalidator leaving a gap?

Status
Not open for further replies.

kaptainobvious

Technical User
Feb 24, 2010
3
US
Hi, first post! I searched the web and cannot find a reason or solution for this....

i want the validator to appear under the form field (text box) so i use code like this:

<br /><asp:RequiredFieldValidator class="note" ID="RequiredFieldValidator1" runat="server" ErrorMessage="Status is Required"
ControlToValidate="txtStatus" Display="Dynamic" ValidationGroup="ApprovedDeniedGroup">
</asp:RequiredFieldValidator>


maybe 70% of the time, it works fine, but the other 30% of the time, there is a large gap left between the field and the text. I cannot figure out why.
 
Not sure if its the same, but i think i had a similar issue, couldn't figure it out completely, but my workaround was to actually put the html inside the error message

ErrorMessage="Status is Required"
to
ErrorMessage="<br/>Status is Required"

(and remove the <br/> in front of your asp:RequiredFieldValidator)


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top