I'm having trouble with the SelectedValue option for SelectedIllems, but for some reason this item will not select the item List ...
My Controller:
Public Task CreateTransformer (string editing) {var tools = GenIDQueries.FindEquipment (edit); See Data ["Feeder"] = New Selection List (Zenith Queries.GateFedder (Tools Oppressure. TowString ()), "CircuitID", "Circuit Description", Device Fidder); See Return (Tools); } is the equipment.Feeder type integer.
My view:
& lt; P & gt; & Lt; P & gt; & Lt;% = Html.LabelFor (M => m.Feeder)%> & Lt; / B & gt; & Lt; Font color = "red" & gt; * & Lt; / Font & gt; & Lt;% = Html.DropDownListFor (m = & gt; m.Feeder, ViewData ["Feeder"] as Selection List, "")% & gt; & Lt;% = HTML.ValidationMessageFor (m = & gt; m.Feeder)% & gt; & Lt; / P & gt; My Genre Queries.getfeder:
Public Fixed IEnumerable & lt; Circuit & gt; GetFeeders (string distNo) {int distNoNumber; Circuit & gt; (). Where (x => x.DistrictCircuitRelations .Any (y = & gt; y.District.DistrictNo == distNoNumber)) (int.TryParse (distNo, outside distNoNumber) {ActiveRecordLinq.AsQueryable & lt go back. Orderbie (x => x.CircuitDescription). Select (x => New Circuit {CircuitID = x. CRQIDID, Circuit Description = X. Circuit Description}); } Return of the new list & lt; Circuit & gt; (); } I have verified that the element I want to select is actually returned by GenIDQueries, but when the page loads, then when choosing the option, the HTML source In the code, the item is not selected either.
When you should set the selected value it is selected circuit id < Set to / code> and not the feeder object.
Comments
Post a Comment