November Happy Hour will be moved to Thursday December 5th.

Dropdown list and dorpdown changed event on the episerver cms website view mode

Vote:
 

I need to show a dropdown list on episerver cms website view mode. Is it possible to add a dropdown list and dropdown changed event on the episerver cms website view mode?

#188838
Mar 05, 2018 13:52
Vote:
 

Controller:

public class ArticlePageController : PageController<ArticlePage>
{
    public ActionResult Index(ArticlePage currentPage)
    {
        ...
    }

    [HttpPost]
    public ActionResult MyDropdownAction(ArticlePage currentPage, string myDropdownValue)
    {
        // Do something with myDropdownValue...
    }
}

View:

@model ArticlePage

@using (Html.BeginForm("MyDropdownAction", "ArticlePage", new { node = Model.ContentLink }, FormMethod.Post))
{
    <select name="myDropDownValue" onchange="this.form.submit()">
        <option value=""></option>
        <option value="myvalue">My text</option>
    </select>
}
#188986
Mar 08, 2018 10:41
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.