title: Populate JQuery Auto-complete from C# dictionary in MVC 4?
body: <p>I have a dictionary that Im passing to the ViewModel that my view is using, however I'm trying to map this dictionary to the JQuery Auto-complete so the textbox can get the key and the value but I can't figure it out yet, here is the code :</p>
  
  <p>//here is my text-box</p>
  
  <pre><code>&lt;input type="text" Id="NewProxy" value="" /&gt;
  </code></pre>
  
  <p>//here the JS code: </p>
  
  <pre><code>$(function () {
  
  var response = '@Html.Raw(Model.Dictionary1)';
  
  
              $( "#NewProxy" ).autocomplete({
                  //  source: response,
                  source:[{
                      label: '@Html.Raw(String.Join(",", Model.Dictionary1.Select(i =&gt; "'" + i.Value + "'")))',
                      value: '@Html.Raw(String.Join(",", Model.Dictionary1.Select(i =&gt; "'" + i.Key + "'")))'
                  }]
              });
  
          });
  </code></pre>
  
  <p>Please note that I don't want to post back for an Ajax Call to get the result as JSON, I already have the data and I want to map it locally.</p>
  
  <p>Thanks in advance!</p>