Here is some code that I am working on which includes a dropdown and a JavaScript function being called from the server side. I am having trouble passing a parameter to the JavaScript function. Can anyone help me resolve this issue?
Server-side code:
Page.ClientScript.RegisterStartupScript(this.GetType(), "Script", "<script type=text/javascript> AddItem(" + EnumRows + ");</script>", true);
JavaScript code:
function AddItem(EnumRows) {
// Create an Option object
// var opt = document.createElement("option");
alert('this');
// Add an Option object to Drop Down/List Box
document.getElementById("<%=cbField.ClientID%>").options.add(opt);
// Assign text and value to Option object
opt.text = Value;
}