Click here to Skip to main content
12,503,681 members (55,126 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: ASP ASP.NET
Hi to all frnds..
I have a problem i am getting some data in repeaters of my master page..and on behalf click of button inside repeater
I sending some data on other page for seeing some detail...

My error is detail is.....

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.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.ArgumentException: 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.



End my repeater design code is ...
<asp:Repeater ID="Repeater1" runat="server"
onitemcommand="Repeater1_ItemCommand">
<ItemTemplate>
<asp:Label ID="Label3" runat="server" Text="Request from"></asp:Label><asp:Button ID="Button1" runat="server" Text='<%#Eval("Name") %>' OnClick="Button1Click" BorderStyle="None" BackColor="#FF2F2F" /><asp:Label ID="Label2" Visible="false" runat="server" Text='<%#Eval("Request_id") %>'></asp:Label> <br />
</ItemTemplate>
</asp:Repeater>

And cs code of button click is..

protected void Button1Click(object sender, EventArgs e)
{

Button btn = (Button)sender;
RepeaterItem item = (RepeaterItem)btn.NamingContainer;
int indexx = item.ItemIndex;
Label lbl=(Label)Repeater1.Items[indexx].FindControl("Label2");
string Valuelbl=lbl.Text;
Response.Redirect("requestDetail.aspx?a=" +Server.UrlEncode(Valuelbl));
}

I m unable to understand the problem...give suggetion frnds, what can i do in this...?
Posted 15-Feb-13 20:40pm
GDdixit542
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

At the page directive at the top of your page add EnableEventValidation="false"
<%@ Page EnableEventValidation="false" %>
  Permalink  
v4
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 2

Here, have a look at this blog post: “Invalid postback or callback argument”[^]
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web01 | 2.8.160919.1 | Last Updated 16 Feb 2013
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100