Hi erveryone, I have a Dropdownlist like this:
<asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True"
onselectedindexchanged="DropDownList1_SelectedInde xChanged">
</asp:DropDownList>
protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
{
Response.Write("DropDownList1_SelectedIndexChanged Fire");
}
Then I have a fucntion on javascript where I bind some data for my DropDownList
<script type="text/javascript" language="javascript">
window.onload = bindDdl;
function bindDdl()
{
// Create an Option object
var opt = document.createElement("option");
// Add an Option object to Drop Down/List Box
document.getElementById("DropDownList1").options.a dd(opt);
// Assign text and value to Option object
opt.text = "Hola Mundo";
opt.value = "Hola Mundo";
var opt1 = document.createElement("option");
// Add an Option object to Drop Down/List Box
document.getElementById("DropDownList1").options.a dd(opt1);
// Assign text and value to Option object
opt1.text = "Hola Mundo1";
opt1.value = "Hola Mundo1";
}
</script>
The problem is that when I select an item from the DropDownList, I get this error:Argument for repayment or invalid callback. Event validation is enabled using <pages enableEventValidation="true"/> in configuration or <% @ Page EnableEventValidation = "true"%> in a page.
I do what the error says put it in the web.config <pages enableEventValidation="false"/> and not get the error but the SelectedIndexChanged does not fire the change in the page directive <% @ Page EnableEventValidation = "false" %> and not fired, and then I change in both and shoots. Any suggestions in this regard.
Edited by WingedPanther, 30 August 2010 - 05:00 PM.
add code tags (the # button)


Sign In
Create Account

Back to top









