Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7429583
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T08:59:31+00:00 2026-05-29T08:59:31+00:00

I am working after a long time in grid and facing an issue. In

  • 0

I am working after a long time in grid and facing an issue.

In grid there are TemplateFields having linkbutton for edit and delete. OnRowCommand event is not firing in gird. An important point is that if I autogenerate Edit or Delete buttons its RowCommand event fires.

Here is my aspx code:

 <asp:GridView ID="gvContact" runat="server" AllowPaging="True" AllowSorting="True"
        DataKeyNames="MailId" AutoGenerateColumns="False" CssClass="ContactsGridViewStyle"
        GridLines="None" OnRowEditing="gv_RowEdit" OnRowDataBound="gv_RowDataBound" OnRowCancelingEdit="gv_CancellingEdit"
        OnRowUpdating="gv_RowUpdating" Width="600px" OnPageIndexChanging="gv_PageChanging"
        OnRowCommand="gv_RowCommand" EmptyDataText="No Record found" EmptyDataRowStyle-ForeColor="Red"
        EmptyDataRowStyle-HorizontalAlign="Center">
        <RowStyle CssClass="RowStyle" />
        <EmptyDataRowStyle CssClass="EmptyRowStyle" />
        <PagerStyle CssClass="PagerStyle" />
        <SelectedRowStyle CssClass="SelectedRowStyle" />
        <HeaderStyle CssClass="HeaderStyle" />
        <EditRowStyle CssClass="EditRowStyle" />
        <AlternatingRowStyle CssClass="AltRowStyle" />
        <Columns>
        <asp:TemplateField HeaderText="Name">
                <EditItemTemplate>
                    <asp:TextBox ID="txtName" runat="server" Text='<%# Bind("Name") %>'></asp:TextBox><br />
                    <asp:RequiredFieldValidator runat="server" ID="rfvName" ControlToValidate="txtName"
                        Display="Dynamic" Text="Name is a required field"></asp:RequiredFieldValidator>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:Label ID="lblName" runat="server" Text='<%# Bind("Name") %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Email Id">
                <EditItemTemplate>
                    <asp:TextBox ID="txtMessageTo" runat="server" Text='<%# Bind("MessageTo") %>'></asp:TextBox><br />
                    <asp:RequiredFieldValidator runat="server" ID="RequiredFieldValidator2" ControlToValidate="txtMessageTo"
                        Display="Dynamic" Text="Email is a required field"></asp:RequiredFieldValidator>
                    <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" Display="Dynamic"
                        Text="Email address is Invalid" SetFocusOnError="true" ValidationExpression="\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"
                        ControlToValidate="txtMessageTo">                    
                    </asp:RegularExpressionValidator>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:Label ID="lblMessageTo" runat="server" Text='<%# Bind("MessageTo") %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField>
                <ItemTemplate>
                    <asp:ImageButton runat="server" ID="ibtn" CommandArgument='<%#Eval("RowId")%>' CommandName="EEE"
                        ImageUrl="~/Images/cross.png" />
                    <asp:LinkButton ID="lbtnEdit" runat="server" Text="Edit" CommandArgument='<%# Eval("RowId")%>'
                        CommandName="EE"></asp:LinkButton>
                </ItemTemplate>
                <EditItemTemplate>
                    <asp:LinkButton runat="server" ID="lbtnUpdate" Text="Update" CommandName="UU"></asp:LinkButton>
                    <asp:LinkButton runat="server" ID="lbtnCancel" Text="Cancel" CommandName="CC"></asp:LinkButton>
                </EditItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField>
                <ItemTemplate>
                    <asp:LinkButton ID="lbtnDelete" runat="server" Text="Delete" CommandArgument='<%# Eval("RowId")%>'
                        CommandName="DD"></asp:LinkButton>
                </ItemTemplate>
            </asp:TemplateField>
        </Columns>
    </asp:GridView>

In CS file I am binding grid in !Page.IspostBack.

Any guidance please.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T08:59:32+00:00Added an answer on May 29, 2026 at 8:59 am

    I’ve spent basically a whole day solving this problem myself; this question seemed to show up quite a lot in my Google queries so hopefully this answer will be helpful even though the question itself is quite old.

    The issue is caused by the validators on the page, such as <asp:RequiredFieldValidator>
    The validation of these fields is performed when the update events are fired on the grid, not just when the “OK” button is pressed. Presumably the validation is failing at this point, and therefore the update events are being cancelled before reaching your handlers.

    The solution to this is to use the ValidationGroup attribute of the validators and the action button intended to fire those validations, as described in Scott Guthrie’s post here: http://weblogs.asp.net/scottgu/archive/2004/10/24/246945.aspx

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working on different data structures which are obtained after long computation time. Is
For a long time I have been working with ReSharper. But after seeing CodeRush
Here's the thing... I've been working on this issue for a long time now
Long time reader, first time poster. Working on a web site at http://www.howardpitch.com/ ,
I have modeled an AJAX search after this example a long time ago. I
So after a long time of debugging here is whats happening. (Using Facebooks Graph
For quite a long time , i have been working with tortoise SVN ,
I remember a long time ago when I was working with characters in .NET.
After IIS reset, first hit taking a long time because AppPool is starting and
Unfortunately after very long time i'm re-posting again about the same problem: org.apache.jasper.JasperException: The

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.