Learn how to a build a cloud-first strategyRegister Now


problem in RegularExpressionValidator  in gridview

Posted on 2006-06-08
Medium Priority
Last Modified: 2008-01-09
In ASP.NET 2.0 I have a gridview and a formview.
I need to check a field to contain one capital letter between  A-Z exclude O,L.
I use the  RegularExpressionValidator to check it.
In the cell of the formview it works fine.
In the cell of the gridview it throw an error on each input even if it is a correct letter.
What is the problem?
This is the code in the gridview that fires on each input:

 <asp:RegularExpressionValidator ID="REVAdvrtType" runat="server" ControlToValidate="TBAdvertTypeEdit"
 Display="Dynamic" ErrorMessage="Only A-Z exclude O,L"  ValidationExpression="[A-KMNP-Z]"
Width="154px" ></asp:RegularExpressionValidator>

thid is the code in the formview that works ok:

<asp:RegularExpressionValidator ID="REVAdvrtType" runat="server" ControlToValidate="TBAdvertType"
 Display="Dynamic" ErrorMessage="Only A-Z exclude O,L"  ValidationExpression="[A-KMNP-Z]" Width="154px"></asp:RegularExpressionValidator>
Question by:ANAT2403

Expert Comment

ID: 16862032
Can post your gridview code?

Author Comment

ID: 16871740
Ok I solve the problem . there where blanks in data so I made Trin and it solve the problem.

Accepted Solution

ee_ai_construct earned 0 total points
ID: 16872661
Closed, 500 points refunded.
Community Support Moderator
replacement part #xm34

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

Question has a verified solution.

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

In this Article, I will provide a few tips in problem and solution manner. Opening an ASPX page in Visual studio 2003 is very slow. To make it fast, please do follow below steps:   Open the Solution/Project. Right click the ASPX file to b…
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…
Loops Section Overview
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Suggested Courses

810 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