There is a _Layout page and partial view rendered into this _Layout page via AJAX call as shown below:
Controller:
public ActionResult Index()
{
ViewBag.PageTitle = "Issues";
return PartialView("_Index");
}
On the other hand, there is a title in the _Layout page and I want to update the title with the ViewBag data returned from Controller. But as AJAX call only updates the Page Content, the Page Title cannot be updated as the _Layout page had already been rendered before calling partialview. So, in this scene what is the most suitable approach to update the Page Title? I think I can update it on AJAX success, but if it is possible I would like to update it by just using ViewBag without an extra property or an extra partialview. Any idea?
ViewBag.PageTitle
** field. On the other hand, what is unnecessary? I could not understand. Could you please explain a little bit more? Thanks in advance... – Jack Oct 28 '16 at 07:03ViewBag.PageTitle
` and then in the success call back you can use jquery to move it to the position in the layout after the partial has been added to the DOM (along the lines of [this answer](http://stackoverflow.com/questions/1279957/how-to-move-an-element-into-another-element)) – Oct 28 '16 at 07:07