Is it feasible to transfer the current value of @Html.DropDownListFor
to an action link? I am trying to send the template value to the Sample
controller using the Create
action. The code below is not functioning because @Model.SurveyTemplate
does not return any value. Do I need to use JavaScript
to retrieve it? Any guidance would be appreciated.
Dropdown List:
@Html.LabelFor(model => model.Survey_Template, "Survey Template")
@Html.DropDownListFor(model => model.Survey_Template, new SelectList(
new List<Object>{
new { value = "Style1" , text = "Style1" },
new { value = "Style2" , text = "Style2" },
new { value = "Style3" , text = "Style3"}
},
"value",
"text",
0))
ActionLink:
@Html.ActionLink("_", "Create", "Sample",
new { template = @Model.Survey_Template },
new { @id = "popup-link", @class = "classname2" })