I have an page which contains an asp.net dropdownlist. When I add an item dynamically using javascript:
var opt = document.createElement("option");
opt.text = "text";
opt.value = "value";
document.getElementById("myDDL").options.add(opt);
document.getElementById("myDDL").value = "value";
When I attempt to save the record, I get an error:
Invalid postback or callback argument. Event validation is enabled using... (and much more, you get the gist)
Turning off event validation isn't an option. I've attempted to add code to the page render (RegisterForEventValidation) to get around this to no avail.
Is there an accepted way in ASP.NET 2.0 to add items dynamically to a dropdownlist via the client and to have the ddl postable after that? Thanks!
...
Go to the complete details ...