locked
best practice RRS feed

  • Question

  • User-2017461817 posted

    Hi all,

    I'm working on a project in MVC 5 and was wondering if someone could suggest a best practice for adding an ajax dropdownlist that populates a paged list of data.

    - Knockout?

    - Some booststrap extenstion that I'm not aware of?

    - Standard dropdownlist using a partialview and ajax controller?

    The page uses a view model with several models. Not sure if that matters.

    Thanks!

    Saturday, May 3, 2014 2:34 PM

Answers

  • User1176121428 posted

    Hi aspdotnetnew,

    Thanks for your post.

    According to your description,

    I'm working on a project in MVC 5 and was wondering if someone could suggest a best practice for adding an ajax dropdownlist that populates a paged list of data.

    There is a lot of ways to bind dropdownlist in asp.net mvc  and maintaining dropdownlist state during postback some of them given below.

    • Use viewbag property.
    • Through view model.
    • Use jquery .ajax i.e. asynchronous post back at selected index change of another dropdownlist.

    For more information,you can check this:http://www.dotnetbull.com/2013/08/bind-dropdownlist-in-dotnet-mvc-razor.html

    Hope this helps you.

    Best Regards,

    Eileen

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, May 6, 2014 3:21 AM

All replies

  • User917890880 posted

    you can tried Bootstrap css and js for Dropdown. 

    Other way could be - create a model property as list and you could bind the data in the view.

    Saturday, May 3, 2014 3:32 PM
  • User1176121428 posted

    Hi aspdotnetnew,

    Thanks for your post.

    According to your description,

    I'm working on a project in MVC 5 and was wondering if someone could suggest a best practice for adding an ajax dropdownlist that populates a paged list of data.

    There is a lot of ways to bind dropdownlist in asp.net mvc  and maintaining dropdownlist state during postback some of them given below.

    • Use viewbag property.
    • Through view model.
    • Use jquery .ajax i.e. asynchronous post back at selected index change of another dropdownlist.

    For more information,you can check this:http://www.dotnetbull.com/2013/08/bind-dropdownlist-in-dotnet-mvc-razor.html

    Hope this helps you.

    Best Regards,

    Eileen

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, May 6, 2014 3:21 AM