In the widget config view, I have a popup screen which allows users to select topics from a list model.
On form submit, topics are saved and linked to the proper widget entity but I can't figure out what return value to use in the controller. Since 'Configure' in my plugin controller is a Child Action, I can't return directly to that (or at least I don't know how to). I think I need to return to the Widget controller, Edit Action for the proper widgetId, I just can't seem to figure out the syntax.
Below is the code for TopicAddPopup in my plugin controller. I've also got a btnId and formId which I believe is being passed from the button which brings up the popup. At some point I added these thinking it would help in my solution. I guess I'm just a bit lost on this one.
[HttpPost]
[FormValueRequired("save")]
public ActionResult TopicAddPopup(string btnId, string formId, TopicBannerModel.AddBannerTopicsModel model)
{
if (model.SelectedTopicIds != null)
{
foreach (int id in model.SelectedTopicIds)
{
var topic = _topicService.GetTopicById(id);
if (topic != null)
{
_tbService.InsertBannerTopic(
new BannerTopicsRecord()
{
WidgetId = model.WidgetId,
TopicId = id,
DisplayOrder = 1
});
}
}
}
ViewBag.RefreshPage = true;
ViewBag.btnId = btnId;
ViewBag.formId = formId;
model.BannerTopics = new GridModel<TopicModel>();
return null;
//return View("~/Administration/Views/Widget/Edit.cshtml", model.WidgetId);
}
Thanks in advance for any help.