Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Invalid postback or callback argument

Status
Not open for further replies.

ushtabalakh

Programmer
Jun 4, 2007
132
0
0
Hi there,
I have a combobox and a listbox in my page, they are filled on serverside,when the user selects a value in the list box, and clicks a button he receives this 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."

When I add EnableEventValidation="off", I can't access the selected item in list box with Me.list_serials.SelectedItem.Text.Trim
cause it gives the "Object reference not set to an instance of an object." error.

Any ideas what I should do?
 
this is my page's source

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="serials_users.aspx.vb" Inherits="activation_serials_users" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "<html xmlns=" >
<head>
<title>Serials</title>
</head>
<body >
<form id="form1" runat="server">
<div>
Users:<br />
<asp:DropDownList ID="drp_users" runat="server" Width="328px"></asp:DropDownList>
<asp:Button ID="Button4" runat="server" Text="Read Serials" /><br />
Serials:<br />
<asp:ListBox ID="list_serials" runat="server" Height="144px" Width="328px"></asp:ListBox><br />
<asp:Button ID="Button1" runat="server" Text="add" />
<asp:Button ID="Button2" runat="server" Text="remove" />
<asp:Button ID="Button3" runat="server" Text="serial file" /><br />
<asp:DropDownList ID="drp_newserials" runat="server" Width="328px">
</asp:DropDownList><br />
<br />
<br />
LockText<br />
<asp:TextBox ID="txtquicllock" runat="server" Height="136px" TextMode="MultiLine"
Width="320px"></asp:TextBox><br />
<asp:HyperLink ID="HyperLink1" runat="server"FileToDownload</asp:HyperLink><br />
<asp:Label ID="status" runat="server" ForeColor="Red"></asp:Label></div>
</form>
</body>
</html>
 
This is so weird I only have this in my page's load method:

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Me.IsPostBack = False Then
FillUserNames()
End If
End Sub

Yet when I click on any button, the selected text in my listbox will no be selected anymore.
 
Only "drp_users" keeps it's state when I post back
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top