Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How to get rid of the validation errors from the bottom of the page

Posted on 2014-03-22
2
Medium Priority
?
289 Views
Last Modified: 2014-03-23
I have this simple text box to input an e-mail address.
Email Address  <asp:TextBox ID="anTxbEmail" runat="server" AutoPostBack="true" OnTextChanged="CheckAccountExistence" Width="160px" BackColor="#00CC00" BorderColor="#00CC66" Font-Names="Calibri"></asp:TextBox>

Then I have attached a RequiredField validator....
<asp:RequiredFieldValidator ID="rfEmailAddress" runat="server" ControlToValidate="anTxbEmail" ErrorMessage="Email Required." Display="Dynamic" SetFocusOnError="true" />

Then I have attached  a Validation Summary...
<asp:ValidationSummary ID="ValidationSummary" ShowSummary="False"  ShowMessageBox ="true" runat="server"  />


Now the problem I have is when I click the OK button while having the email text box empty, yes it shows the error on the Message Box BUT it still shows the same error at the bottom of the page in spite of saying ShowSummary="False".

What I am not doing right here?
0
Comment
Question by:prain
2 Comments
 
LVL 29

Accepted Solution

by:
Paul Jackson earned 1000 total points
ID: 39948192
I suspect what you are seeing is not the validation summary but the validator itself, you need to set the Display property to None :

<asp:RequiredFieldValidator ID="rfEmailAddress" runat="server" ControlToValidate="anTxbEmail" ErrorMessage="Email Required."  Display="None" SetFocusOnError="true" />
0
 

Author Closing Comment

by:prain
ID: 39948633
Perfect. Thank you :-).
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

The purpose of this article is to demonstrate how we can use conditional statements using Python.
Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
Use Wufoo, an online form creation tool, to make powerful forms. Learn how to choose which pages of your form are visible to your users based on their inputs. The page rules feature provides you with an opportunity to create if:then statements for y…
Suggested Courses

916 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