title: How to get the DropDown selected value in controller in MVC3?
body: <p>Hi all i have to get the selected value from dropdown into my post method in controller ..how can i do this</p>
  
  <p>here is my controller</p>
  
  <pre><code>       [AcceptVerbs(HttpVerbs.Get)]
      public ActionResult AddNew()
      {          
          ViewBag.Roles = new SelectList(List(), "RoleID", "RoleName");           
          return View();
      }
      //
      //Geting All Roles In a GetRoles()/
      //
      public List&lt;ResourceModel&gt; List()
        {
            var roles = new List&lt;ResourceModel&gt;();
          SqlConnection conn = new SqlConnection("Data Source=LMIT-0039;Initial Catalog=BugTracker;Integrated Security=True");
          SqlCommand Cmd = new SqlCommand("Select GroupId,EmplopyeeRole from  EmployeeGroup", conn);
          conn.Open();
          SqlDataAdapter da = new SqlDataAdapter(Cmd);
          DataSet ds = new DataSet();
          da.Fill(ds);
          for (int i = 0; i &lt;= ds.Tables[0].Rows.Count - 1; i++)
          {                                
              var model = new ResourceModel();
              model.RoleId = Convert.ToInt16(ds.Tables[0].Rows[i]["GroupId"]);
              model.RoleName = ds.Tables[0].Rows[i]["EmplopyeeRole"].ToString();               
              roles.Add(model);
          }
            conn.Close();
            return roles ;
        }
  
      //
      //To perform the AddNew Logic..i.e it adds a new employee to DB/
      //
      [AcceptVerbs(HttpVerbs.Post)]
      public ActionResult AddNew(ResourceModel model)
      {
          // var modelList = new List&lt;ProjectModel&gt;();
          using (SqlConnection conn = new SqlConnection("Data Source=LMIT-0039;Initial Catalog=BugTracker;Integrated Security=True"))
          {
              conn.Open();
              SqlCommand insertcommande = new SqlCommand("InsertEmplyoee", conn);
              insertcommande.CommandType = CommandType.StoredProcedure;
              insertcommande.Parameters.Add("@EmployeeName", SqlDbType.VarChar).Value = model.EmployeeName;
              insertcommande.Parameters.Add("@EmployeeEmailId", SqlDbType.VarChar).Value = model.EmployeeEmailId;
              insertcommande.Parameters.Add("@EmployeePassword", SqlDbType.VarChar).Value = model.EmployeePassword;
              insertcommande.Parameters.Add("@GroupName", SqlDbType.VarChar).Value = model.RoleName;
              insertcommande.ExecuteNonQuery();
          }
          return View();
      } 
  </code></pre>
  
  <p>now i want to get the selected value @GroupName Parameter in my postmethod...can any one help how to do thi</p>
  
  <p>this is my html</p>
  
  <pre><code>  &lt;%:Html.DropDownList("Roles")%&gt;
  </code></pre>