title: Passing selected text of dropdownlist through json
body: <p>I want to get the text of selected option from the dropdownlist in the controller method.
  But with the below code, I get only the initial text not the changed text.</p>
  
  <p>data.jsonOfLog which is before data.submit, gets the changed text, but it is not this text which is passed to the controller.</p>
  
  <p>In Controller:</p>
  
  <pre><code>[HttpPost]
  public JsonResult GoodSave(string jsonOfLog)
  {
  </code></pre>
  
  <p>In View:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
          $(function () {                 
              json = { jsonOfLog: $("#ddlDocumentType option:selected").text() };
              $('#fileupload').fileupload({
                  dataType: 'json',
                  contentType: 'application/json; charset=utf-8',
                  url: '/Home/GoodSave',
                  data: JSON.stringify(json),
                  add: function (e, data) {
                      $('#fileuploadbutton').click(function () { 
                          data.jsonOfLog = $("#ddlDocumentType option:selected").text();
                          data.submit();
                      })
                  }                
              });
          });
      &lt;/script&gt;
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/cDS3p.jpg" alt="enter image description here"></p>