|
-
Feb 29th, 2012, 06:32 AM
#1
Thread Starter
Fanatic Member
Populating DropdownListFor from JQuery
Hi All,
In my MVC App I have:
Code:
@Html.DropDownListFor(x => x.VehicleTypeId, new SelectList(Model.VehicleTypes, "Id", "Description"), "-- Select --", new { style = "width:200px; border:1px solid blue;" })
The idea is that when records exist, then this will be pre-populated by the model. based on info Stored.
On initial create, I dont pre-populate the combo because the dataset would be huge. I wait until the user has entered enough data in other areas of the screen and then attempt a partial update passing back the information I need to return a more realistic list to populate the combo with.
in my JQuery postback on my success function, I can see that I have valid data being returned in my object. I now want to get that data out of the object and into the dropdownlistfor.
All examples I have found dont use this control, but instead use a simple HTML Select. I have been told by the tech lead that I must use this control anybody any ideas, thanks.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|