Y
yanni
I have some thing like this:
<body>
<form id="form1" runat="server">
<div>
<aspropDownList ID="uxTestDropDownList" runat="server" />
<asp:Button ID="uxSubmitButton" runat="server" Text="Submit"
OnClick="uxSubmitButton_Click" />
</div>
<script type="text/javascript">
var ddl = document.getElementById("uxTestDropDownList");
ddl.options[0] = new Option("Item1", "Item1");
ddl.options[1] = new Option("Item2", "Item2");
ddl.options[2] = new Option("Item3", "Item3");
</script>
</form>
</body>
And in uxSubmitButton_Click, it's just simply:
Response.Write(uxTestDropDownList.SelectedValue);
The "Item1" ~ "Item3" have been successfully added to DropDownList, but when
I click on uxSubmitButton, nothing print on page after post back... How to
make this work? (I have set EnableEventValidation="false" in page directive)
Thanks in advance!
Lei
<body>
<form id="form1" runat="server">
<div>
<aspropDownList ID="uxTestDropDownList" runat="server" />
<asp:Button ID="uxSubmitButton" runat="server" Text="Submit"
OnClick="uxSubmitButton_Click" />
</div>
<script type="text/javascript">
var ddl = document.getElementById("uxTestDropDownList");
ddl.options[0] = new Option("Item1", "Item1");
ddl.options[1] = new Option("Item2", "Item2");
ddl.options[2] = new Option("Item3", "Item3");
</script>
</form>
</body>
And in uxSubmitButton_Click, it's just simply:
Response.Write(uxTestDropDownList.SelectedValue);
The "Item1" ~ "Item3" have been successfully added to DropDownList, but when
I click on uxSubmitButton, nothing print on page after post back... How to
make this work? (I have set EnableEventValidation="false" in page directive)
Thanks in advance!
Lei