Click here to Skip to main content
16,012,107 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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

At the page directive at the top of your page add EnableEventValidation="false"
C#
<%@ Page EnableEventValidation="false" %>
 
Share this answer
 
v4
Here, have a look at this blog post: “Invalid postback or callback argument”[^]
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900