title: Can't set selected value in select2 plugin in Bootstrap
body: <p>I use a select2 plugin my website. I can't set selected value in select2. Please see my code below.</p>
  
  <p><strong>Html</strong></p>
  
  <pre><code> &lt;input id="drpEditProvider" class="form-control" type="text" value="" tabindex="8" name="ProviderId" data-required="true" /&gt;
  </code></pre>
  
  <p><strong>Script</strong></p>
  
  <pre><code>  var attendeeUrl = '@Url.Action("GetProvider", "Admin")';
      var pageSize = 100;
  
      $('#drpEditProvider').select2(
      {
          placeholder: 'Please Select Provider',
          //Does the user have to enter any data before sending the ajax request
          minimumInputLength: 0,
          allowClear: true,
      //tags:["red", "green", "blue"],
          ajax: {
              ////How long the user has to pause their typing before sending the next request
              //quietMillis: 150,
              //The url of the json service
              url: attendeeUrl,
              dataType: 'jsonp',
              //Our search term and what page we are on
              data: function (term, page) {
                  return {
                      pageSize: pageSize,
                      pageNum: page,
                      searchTerm: term
                  };
              },
              results: function (data, page) {
                  //Used to determine whether or not there are more results available,
                  //and if requests for more data should be sent in the infinite scrolling
                  var more = (page * pageSize) &lt; data.Total;
                  return { results: data.Results, more: more };
              }
          },
          initSelection: function (element, callback) {
              var data = [];
              $(element.val().split(",")).each(function () {
                  data.push({ id: this, text: this });
              });
              callback(data);
          },
      });
  </code></pre>
  
  <p><strong>Controller and model</strong></p>
  
  <pre><code>    public class Select2PagedResult
      {
         public int Total { get; set; }
         public List&lt;Select2Result&gt; Results { get; set; }
      }
      public class Select2Result
      {
         public string id { get; set; }
         public string text { get; set; }
      }
      public JsonResult GetProvider(string searchTerm, int pageSize, int pageNum)
      {
          int Count = 0;
  
          List&lt;Provider&gt; provideres = ProviderHelper.GetAllProvider(searchTerm, out Count);
  
          //Translate the attendees into a format the select2 dropdown expects
          Select2PagedResult pagedProvider = new Select2PagedResult();
  
          pagedProvider.Results = new List&lt;Select2Result&gt;();
  
          //Loop through our attendees and translate it into a text value and an id for the select list
          foreach (Provider a in provideres)
          {
              pagedProvider.Results.Add(new Select2Result { id = a.Id.ToString(), text = a.Name });
          }
          //Set the total count of the results from the query.
          pagedProvider.Total = Count;
  
          //Return the data as a jsonp result
          return new JsonpResult
          {
              Data = pagedProvider,
              JsonRequestBehavior = JsonRequestBehavior.AllowGet
          };
      }
  </code></pre>