Solved

validation summary control not getting displayed in asp.net

Posted on 2006-11-03
4
816 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
[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
  • 2
  • 2
4 Comments
 
LVL 6

Accepted Solution

by:
badalpatel earned 500 total points
ID: 17872556
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
ID: 17872723
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
ID: 17872750
can u give me ur code???
0
 
LVL 1

Author Comment

by:s_monani
ID: 17879017
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

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

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

An enjoyable and seamless user experience can go a long way on an eCommerce site. While a cohesive layout and engaging copy play roles in creating a positive user experience, some sites neglect aspects that seem marginal but in actuality prove very …
Does your audience prefer people in photos or no people? How can you best highlight what you’re selling? What are your competitors doing, and what can you do that is different and unique from them?  Continue reading to learn how to make your images …
The viewer will learn how to count occurrences of each item in an array.
The is a quite short video tutorial. In this video, I'm going to show you how to create self-host WordPress blog with free hosting service.

623 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