We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to get the selected values in postback in DropdownlistFor control ?

Platform: ASP.NET MVC |
Control: DropDownList


The DropDownList control supports strongly typed HTML helpers represented by lambda expressions that have model or template passed into the View.



You can get the selected values of  DropDownListFor control in postback by passing the parameter as a string array in code behind.


The following steps to explain how to get the selected item in post back.

  1. Create the model as shown below code:



public class TestDroDownModel  
    public string DropDownItems { get; set; } 


  1. Create an action method that renders UI on the view page, and passes the model to be bound to the view page.


 public ActionResult DropdownlistFeatures()
            DropDownListProperties ddlval = new DropDownListProperties();
            ddlval.DataSource = GetDataSource();
            DropDownListFields ddf = new DropDownListFields();
            ddf.Text = "Text";
            ddf.Id = "uniqueKey";
            ddf.Value = "Value";
            ddf.Selected = "Selected";
            ddlval.DropDownListFields = ddf;
            ViewData["ddl"] = ddlval;
            return View();




  1. Create a strong typed view based on your model.


@using (Html.BeginForm())
          @Html.EJ().DropDownListFor(model => model.ddl, (Syncfusion.JavaScript.Models.DropDownListProperties)ViewData["ddl"]).DropDownListFields(df=>df.Text("Text").Value("Value").Selected("Selected")).ShowCheckbox(true).WatermarkText("Select a car").Width("300px")
  1. Get the selected item in code behind as shown below:



        public ActionResult DropdownlistFeatures(string[] DropDownItems) 
            return View(); 



You can get the selected values in the post action as follows:

Selected values in dropdown postback

2X faster development

The ultimate ASP.NET MVC UI toolkit to boost your development speed.
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile