Pass Selected DropDownList Value to Controller in ASP.Net MVC

Last Reply one month ago By GuruLogu

Posted one month 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%;" })
</div>

 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

 


Posted one month ago

Its Working dharmendr..Thanks for that

I agree, here is the link: http://e-iceblue.com/free-api