Pass Selected DropDownList Value to Controller in ASP.Net MVC

Last Reply one year ago By GuruLogu

Posted one year ago

Code Behind in View Page

<div class="form-group col-md-6">
  @Html.LabelFor(model => model._packagetype_, htmlAttributes: new { @class = "control-label col-md-2" })
<div class="col-md-10">
   @Html.DropDownListFor(model => model._packagetype_, Model.PackageTypeList_.Select(m => new SelectListItem { Text = m.Package, Value = Convert.ToString(m.Package_id) }), "Select", new { @class = "select-select2", style = "width: 100%;" })

 Code behind in Controller

 var _packagetype = Request.Form["_packagetype_"].ToString();

Here i'm getting integer value of  _packagetype is 1,2... but i need a string inside the textbox