Virtual Happy Hour this month, Jun 28, we'll be getting a sneak preview at our soon to launch SaaS CMS!

Try our conversational search powered by Generative AI!

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.