ASP.net
Awesome
Learn
Forum
Buy
Demos
Sign In
☾
☀
Switch to
Dark
Light
Mode
this site works best with javascript enabled
Ask Question
Unable to get DropdownList by placing it in EditorTemplates
Title:
B
I
{code}
?
public class A { // Other class members... [UIHint("DropdownList")] public int? CityHomeId { get; set; } // Other class members... } // end class DropdownList.cshtml in EditorTemplates @{ Layout = "_FieldLayout.cshtml"; ViewData["__idpostfix"] = "-awe"; } @Html.Awe().DropdownList(new DropdownListOpt { Name = "", Url = Url.Action("GetTreeNodesLazy", "Property", new { @Area = "Admin" }), ClearBtn = true, CollapseNodes = true, PopupMinWidth = 350, } .RemoteSearch(Url.Action("SearchTree", "Property", new { @Area = "Admin" }))) .... @using (Html.BeginForm("Create", "Personal", new { @Area = "Human", enctype = "multipart/form-data" }, FormMethod.Post)) { using (Html.Saturn().BeginContext()) { @Html.EditorFor(o => o.CityHomeId) } } DropdownList fill with Data *CityHomeId* does not show *_item_* when editing CityHomeId is *value* . There is a special point, something else needs to be done.
Save Changes
Cancel
Arash Ansari
asked 19 days ago
unless you're using some custom wrapper, it should be `Html.Awe().DropdownList`; there are EditorTemplates for the DropdownList in our main demo that you can use as an example
19 days ago
Omu
Answers
please
Sign In
to leave an answer
By accessing this site, you agree to store cookies on your device and disclose information in accordance with our
cookie policy
and
privacy policy
.
OK