problem in RegularExpressionValidator  in gridview

Posted on 2006-06-08
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
    LVL 4

    Expert Comment

    Can post your gridview code?

    Author Comment

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

    Accepted Solution

    Closed, 500 points refunded.
    Community Support Moderator
    replacement part #xm34

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Suggested Solutions

    I have developed many web applications with asp & and to add and use a dropdownlist was always a very simple task, but with the new, setting the value is a bit tricky and its not similar to the old traditional method. So in this a…
    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…
    In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

    759 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

    Need Help in Real-Time?

    Connect with top rated Experts

    9 Experts available now in Live!

    Get 1:1 Help Now