I’m using ASP.NET MVC- I’ve got a DropDownList rendered in a user control (ascx page). Here’s the code from the ascx page:
<%: Html.DropDownList("climed_pharm_fk",
new SelectList(ViewData["Pharmacies"] as IEnumerable,
"pharm_pk", "pharm_name", Model.climed_pharm_fk))%>
<%= Html.ActionLink("Add New", "Create", "PharmacyMaintenance",
new { Area = "" },
new { target="_blank" })%>
Currently, “pharm_name” shows up in the drop down list. That’s great and all, but I am needing “pharm_name” as well as “pharm_phone”. I tried stuff like:
<%: Html.DropDownList("climed_pharm_fk",
new SelectList(ViewData["Pharmacies"] as IEnumerable,
"pharm_pk","pharm_name,pharm_phone",Model.climed_pharm_fk))%>
<%= Html.ActionLink("Add New", "Create", "PharmacyMaintenance",
new { Area = "" },
new { target="_blank" })%>
But that didn’t work obviously. How does one go about doing this? Thanks in advance!
Try this: