Solved

ASP.NET RequiredFieldValidator - Show required fields in summary

Posted on 2013-11-25
1
382 Views
Last Modified: 2013-11-26
I've used the '*' as the RequiredFieldValidator Error Message.  How do I display the name of the required fields in the summary?

  See the attachment.
I'm using Visual Studio 2005 and C#

label>PartNumber: </label>
                    <asp:TextBox ID="PartNumberTextBox" runat="server" Text='<%# Bind("PartNumber") %>' />                        
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" ControlToValidate="PartNumberTextBox"
                    runat="server" ErrorMessage="*"></asp:RequiredFieldValidator>
RequiredFields.png
0
Comment
Question by:cookiejar
1 Comment
 
LVL 29

Accepted Solution

by:
Paul Jackson earned 500 total points
ID: 39676184
Use the errormessage property to specify the error message to be shown in the summary, use the text property to show the * by the field that is required :

<asp:RequiredFieldValidator ID="RequiredFieldValidator1" ControlToValidate="PartNumberTextBox"
                    runat="server" ErrorMessage="Part Number is required" Text="*"></asp:RequiredFieldValidator>
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Sometimes in DotNetNuke module development you want to swap controls within the same module definition.  In doing this DNN (somewhat annoyingly) swaps the Skin and Container definitions to the default admin selections.  To get around this you need t…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

760 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

16 Experts available now in Live!

Get 1:1 Help Now