Button Inside Header template of Gridview--gives error on click

Discussion in 'ASP .Net' started by divya, Aug 9, 2007.

  1. divya

    divya Guest

    I have used a button in the header of a gridview which has submit
    behaviour true .

    <asp:TemplateField HeaderText="Notify By Mail">
    <ItemTemplate>
    <asp:CheckBox ID="chkNotify" runat="server" />&nbsp;
    </ItemTemplate>
    <HeaderTemplate>
    <asp:Button ID="btnnotify" runat="server"
    CausesValidation="False" CssClass="button"
    Font-Bold="True" Text="Notify by Email"
    CommandName="notify" />&nbsp;
    </HeaderTemplate>
    </asp:TemplateField>

    When I click on this button I recieve the error :-

    "Invalid postback or callback argument. Event validation is
    enabled using <pages enableEventValidation="true"/> in configuration
    or <%@ Page EnableEventValidation="true" %> in a page. For security
    purposes, this feature verifies that arguments to postback or callback
    events originate from the server control that originally rendered
    them. If the data is valid and expected, use the
    ClientScriptManager.RegisterForEventValidation method in order to
    register the postback or callback data for validation."

    I recieve this error only if "submit behaviour is true" .

    How do I make this button persent in the header of the gridview work
    as a Submit button. I only need the values of the gridview which holds
    this button.

    Regards,
    Divya
    divya, Aug 9, 2007
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Purvi T
    Replies:
    0
    Views:
    821
    Purvi T
    Oct 19, 2004
  2. Amy
    Replies:
    0
    Views:
    961
  3. Santosh
    Replies:
    0
    Views:
    720
    Santosh
    Aug 2, 2006
  4. Santosh
    Replies:
    0
    Views:
    1,848
    Santosh
    Aug 4, 2006
  5. VijayRama
    Replies:
    2
    Views:
    2,298
    Gregory A. Beamer
    Oct 12, 2009
Loading...

Share This Page