title: Save the selected value of a drop down in global variable
body: <p>How can I save the value of a selected dropdown in a global variable in MVC.I have to save the changed value in a variable named "no_of_days" whenever the value is changed.</p>
  
  <pre><code>@{
      Layout = null;
      string no_of_days = "6";
  }
  &lt;body&gt;
     &lt;div class="document_dashboard_dropdown ms-Dropdown" tabindex="0"&gt;
        &lt;i class="ms-Dropdown-caretDown ms-Icon ms-Icon--caretDown"&gt;&lt;/i&gt;
        &lt;select id="no_of_days" class="ms-Dropdown-select"&gt;
           &lt;option value="6" class="ms-Dropdown-item " selected="selected"&gt;last 6 months&lt;/option&gt;
            &lt;option value="7" class="ms-Dropdown-item"&gt;last 7 months&lt;/option&gt;
                  &lt;option value="8" class="ms-Dropdown-item"&gt;last 8 months&lt;/option&gt;
                  &lt;option value="9" class="ms-Dropdown-item"&gt;last 9 months&lt;/option&gt;
                  &lt;option value="10" class="ms-Dropdown-item"&gt;last 10 months&lt;/option&gt;
                  &lt;option value="11" class="ms-Dropdown-item"&gt;last 11 months&lt;/option&gt;
                  &lt;option value="12" class="ms-Dropdown-item"&gt;last year&lt;/option&gt;
         &lt;/select&gt;
      &lt;/div&gt;
  &lt;/body&gt;
  
  &lt;script&gt;
      $(document).ready(function() {
         $('#no_of_days').change(function () {
          '@no_of_days'=$('#no_of_days').val()
         });
      });
  &lt;/script&gt;
  </code></pre>
  
  <p>I am not able to get any value in @no_of_days variable. I want to do a Ajax.ActionLink call so I need the real-time value of @no_of_days</p>