How to find selected dropdownlist value during post method without javascript jquery
<div class="form-group">
@Html.LabelFor(model => model.Org_Name, htmlAttributes: new { @class = "control-label col-md-2" })
<div class="col-md-10">
@Html.EditorFor(model => model.Org_Name, new { htmlAttributes = new { @class = "form-control" } })
@Html.ValidationMessageFor(model => model.Org_Name, "", new { @class = "text-danger" })
</div>
</div>
<div class="form-group">
@Html.LabelFor(model => model.State, htmlAttributes: new { @class = "control-label col-md-2" })
<div class="col-md-10">
@Html.DropDownListFor(model => model.State, (IEnumerable<SelectListItem>)ViewBag.States, new { @class = "form-control",@id="ddrstate" })
@Html.ValidationMessageFor(model => model.State, "", new { @class = "text-danger" })
</div>
</div>
var stat = db.States.ToList();
//Assigning generic list to ViewBag
List<SelectListItem> Statlist = new List<SelectListItem>();
foreach (State item in stat)
{
Statlist.Add(new SelectListItem
{
Text = item.State1,
Value = item.State_id.ToString()
});
}
ViewBag.States = Statlist;
return View();
on post method
public ActionResult SignUp(orgn_detail orgt)
{
organisation org = new organisation();
org.Org_Name = orgt.Org_Name;
org.State = orgt.State.ToString();//not able to find selected state value here?????
}