I'm getting this error but can't determine why. When I evaluate Request.Form("eo_cb_id") it has a length of 0 instead of being nothing.
Exception: System.Web.HttpUnhandledException: Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> System.ArgumentException: Invalid postback or callback argument. Event validation is enabled using <pages enableEventValidation="true"/> in configuration or <%@ Page EnableEventValidation="true" %> in a page.
I am using the call back in the following manner. The auto refresh value in function afterAddTask is equal to 1 so a postback happens. it is on this post back when the error occurs.
Code: HTML/ASPX
<a href="#" style="cursor:hand;">
<asp:Image ID="btnAddTask" runat="server" ImageUrl="~/images/timecard1.gif" onclick="addTask()" />
</a>
Code: HTML/ASPX
<eo:CallbackPanel ID="CallbackPanel_AddTasks" runat="server" Height="26px" Width="100%" ClientSideAfterUpdate="afterAddTask">
<table width="100%">
<tr>
<td id="cell_addtask_status" runat="server" align="left" enableviewstate="false">
<asp:Label ID="lblAddTaskStatus" runat="server" Text="" EnableViewState="false"></asp:Label>
<asp:BulletedList ID="bllAddTaskMessages" runat="server" EnableViewState="false">
</asp:BulletedList>
<br />
</td>
</tr>
</table>
</eo:CallbackPanel>
Code: JavaScript
function addTask() {
try {
var list = eo_GetObject("<%=lsbTasks.ClientID %>");
var item = list.getSelectedItem();
var item_value = item.getValue();
var item_value_parts = item_value.split(";");
var id_parts = "<%=lsbTasks.ClientID %>".split("_");
var parm = item_value_parts[0] + "|";
var callback = false;
for (x = 1; x < 8; x++) {
var txt = document.getElementById(id_parts[0] + "_" + id_parts[1] + "_txtInputDay" + x);
if (txt != null) {
var value = txt.value;
if (value.length == 0 ) {
value = "-1";
} else {
callback = true;
}
parm += value + ";";
} else {
parm += "-1;";
}
}
if (callback == true) {
eo_Callback("CallbackPanel_AddTasks", parm.substr(0, parm.length-1));
} else {
alert("Please enter time then click the save button...");
}
}catch(err) {
alert(err);
}
}
function afterAddTask(callback) {
var list = eo_GetObject("<%=lsbTasks.ClientID %>");
var item = list.getSelectedItem();
var item_value = item.getValue();
var item_value_parts = item_value.split(";");
var id_parts = "<%=lsbTasks.ClientID %>".split("_");
if (document.getElementById("<%=hfAutoRefresh.ClientID %>").value == "1") {
postBack();
} else {
}
}
function postBack() {
__doPostBack('__Page','NewTask');
}