This question is locked. New answers and comments are not allowed.
Okay I must be missing something simple...
I have a combo box on my page and it is loaded with the telerik themes. The intent is to allow the user to change the theme and have the site update as soon as the theme is selected. Here is my controller code:
Here is my view code:
When the selection is changed, I would like it to fire off the Index method in the Home Controller again, and I thought it would due to the .PostTo line on the HtmlConfigurator but nothing happens when the selection is changed. What am I missing?
Thanks!!
I have a combo box on my page and it is loaded with the telerik themes. The intent is to allow the user to change the theme and have the site update as soon as the theme is selected. Here is my controller code:
public
ActionResult Index(ThemeComboBoxModel model)
{
ViewBag.Message =
"Welcome to Contoso University!"
;
model.DropDownListAttributes.Width = model.DropDownListAttributes.Width ?? 200;
model.DropDownListAttributes.SelectedIndex = model.DropDownListAttributes.SelectedIndex ?? 0;
model.DropDownListAttributes.SelectedValue = model.DropDownListAttributes.SelectedValue ??
"telerik.Default.css"
;
model.Themes = _LoadThemeList();
_Profile.Theme = model.DropDownListAttributes.SelectedValue;
ViewBag.Theme = _Profile.Theme;
return
View(model);
}
Here is my view code:
@(Html.Telerik().DropDownList()
.Name("DropDownListTheme")
.SelectedIndex(Model.DropDownListAttributes.SelectedIndex.Value)
.BindTo(new SelectList(Model.Themes, "ThemeId", "ThemeName"))
.HtmlAttributes(new { style = string.Format("width:{0}px", Model.DropDownListAttributes.Width) })
)
@using (Html.Configurator("The DropDownList should...")
.PostTo("Index", "Home")
.Begin())
{
}
When the selection is changed, I would like it to fire off the Index method in the Home Controller again, and I thought it would due to the .PostTo line on the HtmlConfigurator but nothing happens when the selection is changed. What am I missing?
Thanks!!