Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

ASP.NET RequiredFieldValidator - Show required fields in summary

Posted on 2013-11-25
1
Medium Priority
?
405 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 29

Accepted Solution

by:
Paul Jackson earned 2000 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

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…
One of the pain points with developing AJAX, JavaScript, JQuery, and other client-side behaviors is that JavaScript doesn’t allow for cross domain request for pulling content. For example, JavaScript code on www.johnchapman.name could not pull conte…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Suggested Courses

596 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