title: Save DropDownList value into a javascript variabale
body: <p>I am relatively new to C#, and I have been researching this across the internet for a few days now. I need the value selected in asp.net DropDownList to be declared as a JavaScript variable. I have looked into <code>&lt;asp:hiddenfield&gt;</code>'s mostly, but I'm not sure if this is the best option to go down. So I have two questions:</p>
  
  <ol>
  <li>Are <code>&lt;asp:hiddenfield&gt;</code>'s the best option?</li>
  <li><p>How do you declare a C# string into a javascript variable?</p>
  
  <pre><code>&lt;asp:DropDownList runat="server" ID="dropDownID"&gt;
      &lt;asp:ListItem Text="-- Select Reason --" Value=""&gt;&lt;/asp:ListItem&gt;
      &lt;asp:ListItem Text="Booking" Value="1"&gt;&lt;/asp:ListItem&gt;
      &lt;asp:ListItem Text="Discussing" Value="2"&gt;&lt;/asp:ListItem&gt;
      &lt;asp:ListItem Text="Quotation" Value="3"&gt;&lt;/asp:ListItem&gt;
  &lt;/asp:DropDownList&gt;
  
  &lt;asp:hiddenfield ID="valueInHiddenField" value="" runat="server"/&gt; 
  </code></pre></li>
  </ol>