1
Good for everyone. I am trying to redirect from one Actionresult to another and I have tried everything unsuccessfully. At this moment I find myself with the following code:
[AllowAnonymous]
public ActionResult Index_GA_ER(string tkn)
{
return RedirectToAction("Index", "Eresults_Base");
}
[ChildActionOnly]
public ActionResult Menu()
{
var menuOptions = Session.GetDataFromSession<List<Menu>>(StoreManagerKeys.Menus);
string tkn = "";
string a = "Eresults_MenuOption_";
if (ConfigurationManager.AppSettings["generateInterfeatures"] != "true" || menuOptions != null)
{
foreach (var button in menuOptions)
{
string b = RemoveDiacritics(button.Description).Replace(" ", "_");
button.MenuClass = a + b;
}
return PartialView(menuOptions);
}
return Index_GA_ER(tkn);
}
For which I have the mistake
Child actions are not allowed to perform redirect actions.
Someone can help out ?
Take a look at your actionfilter if you have it [Actionfilters.Requirehttps(Requiresecure = false)] if it does change to true try again. https://stackoverflow.com/questions/25015833/child-actions-are-not-allo-allowed-to-perform-redirect-actions-after-setting-the-sit
– Thiago Loureiro
The error happens in which row, when it returns the partial or in the method "Index_ga_er"?
– Ricardo Pontual