title: Reset a @HTML.DropDownList & Table on button click without JavaScript or JQuery
body: <p>Hi I need some help as I am new to MVC. I have a Drop Down List that is being populated with values from the config. I am going to use this drop down to pass a value when hitting submit to run a Query and bring back data into a table. </p>
  
  <p>Where I need help:</p>
  
  <p>If a user wants to reset the drop down back to "Choose Your Value" and clear the table of the data for in prep to run a new query, I want them to be able to click the "Clear" button and be able to do so. </p>
  
  <p>I searched a lot and learned a lot about JavaScript ways of doing this, but I would like to use .NET and MVC. </p>
  
  <p>Here is my Drop Down code:</p>
  
  <pre><code>@{
    ViewBag.Title = "Index";
   }
   @Html.DropDownList("YourElementName", 
   (IEnumerable&lt;SelectListItem&gt;)ViewBag.DropdownVals, "--Choose Your Value--", 
   new {
  
          //size = "5",
          style = "width: 600px"
  
          }
  </code></pre>
  
  <p>I have a button like this:</p>
  
  <pre><code>&lt;input id="Button2" type="button" value="Clear" /&gt;
  </code></pre>
  
  <p>Can the button call some code in the controller that will clear both the list and table data?</p>
  
  <p>Please explain in detail if you have time. </p>
  
  <p>Any help is much appreciated. </p>
  
  <p>Controller as it is right now:</p>
  
  <pre><code>public ActionResult Index()
      {
          //ViewBag.Message = "Modify this template to jump-start your ASP.NET MVC application.";
  
          string[] values = (ConfigurationManager.AppSettings["DropdownValues"]).Split(',').Select(sValue =&gt; sValue.Trim()).ToArray();
          List&lt;SelectListItem&gt; dropDowns = new List&lt;SelectListItem&gt;();
          for (int i = 0; i &lt; values.Length; i++)
          {
              dropDowns.Add(new SelectListItem { Text = values[i], Value = values[i] });
          }
          ViewBag.DropdownVals = dropDowns;
  
  
          return View();
      }
  </code></pre>