Click here to Skip to main content
15,895,709 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i am trying to get red asterisk on the top right next to the textbox in gridview footer template.red asterisk is taking space and displaying at the bottom of the textbox

What I have tried:

i tried by keep the display property of requiredfield validator to dynamic but it's taking the space at bottom the textbox to display red asterisk as a result of this textbox does not align with the remaining textboxes in the footer template.

<FooterTemplate>
                            <asp:TextBox ID="txtNameFooter"  runat="server"/>
                            <asp:RequiredFieldValidator ID="nameRequiredFieldValidator" runat="server" Visible="True" ErrorMessage="Name is a Required Field" Display="Dynamic" ForeColor="Red" ControlToValidate="txtNameFooter" CssClass="required-field" Text="*"></asp:RequiredFieldValidator> 
                        </FooterTemplate>                      


please let me know how can i achieve this?
Posted
Comments
Richard Deeming 31-Jan-20 11:52am    
Sounds like you have a style attached to your textbox which makes it take the full width of its container. That will force the validation message to appear on a new line.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900