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

x
?
Solved

validation summary control not getting displayed in asp.net

Posted on 2006-11-03
4
Medium Priority
?
821 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 1500 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Color can increase conversions, create feelings of warmth or even incite people to get behind a cause. If you want your website to really impact site visitors, then it is vital to consider the impact color has on them.
When it comes to security, close monitoring is a must. According to WhiteHat Security annual report, a substantial number of all web applications are vulnerable always. Monitis offers a new product - fully-featured Website security monitoring and pr…
This video teaches users how to migrate an existing Wordpress website to a new domain.
The viewer will learn how to dynamically set the form action using jQuery.
Suggested Courses

824 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