is there way thats i can preselect an item when the page loads or posts to the server..
this is what i have right now..
<%=Html.DropDownList("dllMonths",
new SelectList(new List<string>() {
"", "January", "Feburary", "March", "April", "June",
"July", "August", "September", "October", "November",
"December"}),
new { onchange="this.form.submit();" })%>
Set the SelectedValue property of the SelectList, or pass it as second parameter to SelectList constructor.
<% = Html.DropDownList ( "dllMonths",
new SelectList ( new List ( )
{ "", "January", "Feburary", "March",
"April", "June", "July", "August",
"September", "October", "November",
"December" },
"April" ),
new { onchange = "this.form.submit();" }
)%>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With