How to bind ViewData value to dropdownlist

2 posts, 0 answers
  1. mano
    mano avatar
    1 posts
    Member since:
    Aug 2015

    Posted 21 Aug 2015 Link to this post

    I assign user id and user name in viewdata,How to bind viewdata in dropdownlist using jquery.


    var User=JSON.Parse('@html.Raw(Json.Encode(ViewData["UserDetails"]))');


              height : 150,

                 dataTextField : "name_function_club",

                  dataValueField: "id_function_club",

                 ​BindTO: User


  2. Boyan Dimitrov
    Boyan Dimitrov avatar
    1728 posts

    Posted 24 Aug 2015 Link to this post

    Hello mano,


    In this forum discussion is explained how to access data from the ViewData from jQuery. I would suggest to use the data method of the DataSource in order to set the data retrieved from the ViewData. 


    Boyan Dimitrov
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top