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. Advertisements

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:
    1,122
    Purvi T
    Oct 19, 2004
  2. Amy
    Replies:
    0
    Views:
    1,247
  3. Santosh
    Replies:
    0
    Views:
    812
    Santosh
    Aug 2, 2006
  4. Santosh
    Replies:
    0
    Views:
    1,995
    Santosh
    Aug 4, 2006
  5. Replies:
    4
    Views:
    577
  6. =?Utf-8?B?U21pdGE=?=

    Listbox inside a Gridview gives a nullpointer exception

    =?Utf-8?B?U21pdGE=?=, May 30, 2007, in forum: ASP .Net
    Replies:
    1
    Views:
    407
    Alexey Smirnov
    May 31, 2007
  7. VijayRama
    Replies:
    2
    Views:
    2,617
    Gregory A. Beamer
    Oct 12, 2009
  8. KJ
    Replies:
    3
    Views:
    571
Loading...