Solved

validation summary control not getting displayed in asp.net

Posted on 2006-11-03
4
813 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
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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Read about why website design really matters in today's demanding market.
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
Viewers will get an overview of the benefits and risks of using Bitcoin to accept payments. What Bitcoin is: Legality: Risks: Benefits: Which businesses are best suited?: Other things you should know: How to get started:
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…

777 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