Solved

Help on Validation Summary Control

Posted on 2009-04-10
2
287 Views
Last Modified: 2012-05-06
Hi,

I have Sales report form.There are two types of users who use it.

If User1 type logs in, i have to show him  both Order Textbox and Travel TextBox.When User2 type log in, i have to show him only Travel Texbox.

I have required field validators for order textbox and another Req Val for Travel textbox.I have two set of validation Summary .one for Order and another for travel.

When the User1 type logs in and does not enter the required textboxes, i get the correct error messages.

When the User 2 type  logs in and even though he dose not need to enter the order textbox(it will not be rendered on the page itself), i get an error message showing enter order textbox,WHICH SHOULD NOT BE THE CASE.

 Please help me point my mistake.

I have attached a brief code...:


<%If Not (UserTitle.Value = "User2") Then%>
 
<asp:TextBox ID="txtProouct" runat="server" CssClass="Smalltextarea"></asp:TextBox>
 
<asp:RequiredFieldValidator ID="RequiredFieldValidatorprod1" ControlToValidate ="txtProouct" runat="server" ErrorMessage="Select atleast one Product" Text="*"></asp:RequiredFieldValidator>
 
<%End If%>
 
<asp:TextBox ID="txtTravel" runat="server" CssClass="Smalltextarea"></asp:TextBox>
 
<asp:RequiredFieldValidator ID="RequiredFieldValidatortxtTravel" runat="server" ErrorMessage="Enter EndDate" ControlToValidate="txtTravel" ValidationGroup="ValidationSummaryTravel" SetFocusOnError="true" Display="None"></asp:RequiredFieldValidator>
 
<asp:ValidationSummary ID="ValidationSummaryTravel" runat="server" Font-Size="Small" DisplayMode="BulletList" HeaderText="Enter:" EnableClientScript="true" />
 
<asp:ValidationSummary ID="ValidationSummaryOrder" runat="server" Font-Size="Small" DisplayMode="BulletList" HeaderText="Enter:" EnableClientScript="true" /> 
 
=====>>>> I tried Moving this validation ValidationSummaryOrder in "end if "  block..but when user 2 logs in..I get a javascript error saying document.getID() not recognised.

Open in new window

0
Comment
Question by:SaraDob
[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 Comments
 
LVL 9

Accepted Solution

by:
VikramMullick earned 250 total points
ID: 24117182
when user2 logs in , on the page load set
ValidationSummaryOrder.visible = false
0
 
LVL 1

Author Closing Comment

by:SaraDob
ID: 31568973
Thanks for giving a solution just in time....
Thanks again
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

627 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