Solved

validation summary control not getting displayed in asp.net

Posted on 2006-11-03
4
811 Views
Last Modified: 2008-07-03
hi experts,

I m doing one asp.net project in which i have two textbox fields for dates. I m comparing the start date & end date using compare validator.  I also have the Validation Summary control. But whatever error i m Getting the Validation Summary control is not getting displayed & messagebox as well.  What to do in this case?

And My other question is how to add the name of my project to the title bar of the messagebox?

thanx
0
Comment
Question by:s_monani
  • 2
  • 2
4 Comments
 
LVL 6

Accepted Solution

by:
badalpatel earned 500 total points
Comment Utility
u can use the compare validaor as shown below..

<asp:CompareValidator id="valRequired" runat="server" ControlToValidate="textbox1"
    ValueToCompare="50" ' here u can give any other value
    Type="Integer"
    Operator="GreaterThan"
    ErrorMessage="* You must enter the a number greater than 50" Display="dynamic">*
</asp:CompareValidator>

<asp:ValidationSummary id="valSummary" runat="server"
    HeaderText="Errors:" 'in header text u can provide header...
    ShowSummary="true" DisplayMode="List" ShowMessageBox="True") />

The validation summary control will collect all the error messages of all the non-valid controls and put them in a tidy list. The list can be either shown on the web page (as shown in the example above) or with a popup box (by specifying ShowMessageBox="True")

Hope this will solve ur question
0
 
LVL 1

Author Comment

by:s_monani
Comment Utility
hi,
Thanx for u r answer.  Actually all the things as same as u have specified. But i m not getting the messagebox as well as validation summary control is not getting displayed while error occured
 That's the prob.

Thanx
0
 
LVL 6

Expert Comment

by:badalpatel
Comment Utility
can u give me ur code???
0
 
LVL 1

Author Comment

by:s_monani
Comment Utility
thanx for u r reply sir.
The problem that i had added have been solved.  Now i have arised with one other question

I am displaying the validation summary messagebox, Now I don't want to display the contents of the Compare validator at run time.  Actullaly i made the forecolor of the contents to white, But whenever We select a page that contents Got Displayed. The other thing is if i make it invisible. Then it do not show the error in validation summary msgbox.

Can u plz help?

thanx
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Envision that you are chipping away at another e-business site with a team of pundit developers and designers. Everything seems, by all accounts, to be going easily.
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will get a basic understanding of what section 508 compliance can entail, learn about skip navigation links, alt text, transcripts, and font size controls.

744 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

12 Experts available now in Live!

Get 1:1 Help Now