R
rodchar
Hi All,
I'm trying to bind a simple selectlist to my html.dropdownlist but not so
simple for me. I have this so far:
MODEL:
private void LoadDropDownLists(MorrisExpressContext
morrisExpressContext)
{
Dictionary<string, int> ddl = new Dictionary<string, int>();
ddl.Add("Select...", -1);
ddl.Add("15 Minutes", 15);
ddl.Add("30 Minutes", 30);
ddl.Add("60 Minutes", 60);
GridSizes = new SelectList(ddl);
}
VIEW:
<%= Html.DropDownList("UserProfileSettings.GridPageSize", Model.GridSizes)%>
RESULT:
[Select..., -1] is showing up in the dropdownlist (including the brackets)
instead of just showing the text part?
thanks,
rodchar
I'm trying to bind a simple selectlist to my html.dropdownlist but not so
simple for me. I have this so far:
MODEL:
private void LoadDropDownLists(MorrisExpressContext
morrisExpressContext)
{
Dictionary<string, int> ddl = new Dictionary<string, int>();
ddl.Add("Select...", -1);
ddl.Add("15 Minutes", 15);
ddl.Add("30 Minutes", 30);
ddl.Add("60 Minutes", 60);
GridSizes = new SelectList(ddl);
}
VIEW:
<%= Html.DropDownList("UserProfileSettings.GridPageSize", Model.GridSizes)%>
RESULT:
[Select..., -1] is showing up in the dropdownlist (including the brackets)
instead of just showing the text part?
thanks,
rodchar