Bind both static data and dynamic list from the database in one dropdown list in mvc RRS feed

  • Question

  • Hello,

    Please help me in this

    I want to bind static item in the dropdown already dynamic data list is there. In mvc3 how can i add static item to that dropdown?

    Somebody please help me


    @Html.DropDownListFor(model => model.YourModelProperty, 
       (IEnumerable<SelectListItem>)ViewBag.DropDownList, "---Select a value---")

    I want to add one static item 'create new' item to this dropdown.How can i bind ...

    Waiting for your reply

    • Edited by riyaaa Monday, May 25, 2015 10:14 AM
    • Moved by Caillen Tuesday, May 26, 2015 5:45 AM
    Monday, May 25, 2015 9:31 AM


All replies

  • Please post all mvc asp.net questions in this forum.


    Thank you.

    Mark as answer or vote as helpful if you find it useful | Igor

    • Proposed as answer by Fouad Roumieh Monday, May 25, 2015 12:51 PM
    • Marked as answer by Just Karl Monday, June 1, 2015 7:39 PM
    Monday, May 25, 2015 12:46 PM
  • You make a collection, load the static and dynamic data into the collection and bind the collection to the control. 
    Monday, May 25, 2015 6:19 PM