title: How to use a @Html.DropDownList with ViewBag?
body: <p>I'm working with MVC4.</p>
  
  <p>I've added the paging, sorting and filtering functions in an Index page.As a result, I have to add a <strong>viewbag</strong> parameter to the filtering <strong>DropdownList</strong> to keep the filtering string.</p>
  
  <p>Here comes an example of a textbox with a viewbag parameter:</p>
  
  <pre><code>@Html.TextBox("name",ViewBag.CurrentFilterName as string) 
  </code></pre>
  
  <p>This works well.</p>
  
  <p>I want to add a <strong>viewbag</strong> parameter to the <strong>DropDownList</strong>.
  Here comes my HTML code for this DropDownList:</p>
  
  <pre><code>@Html.DropDownList("type","All",ViewBag.CurrentFilterType as string).
  </code></pre>
  
  <p>This is wrong.</p>
  
  <p>Could someone tell me how to correct it?
  Thank you very much!</p>