Possible duplicate:Changing MVC 3 ViewBag in partial view is not saved in _Layout.cshtml
I am trying to set pageTitle from PartialView
Here is my code:
PartialView Template:
@{ ((WebViewPage)WebPageContext.Current.Page).ViewBag.Title = "Page title"; }
_Layout.cshtml:
<title> @ViewBag.Title</title>
How to do it?
This is not what partial should do. He simply does not have to change the parent view ViewBag. And in addition to this, this is not possible. Quote from MSDN :
ViewBag
, ViewDataDictionary, . . , , ViewData . .
, , , . - . .
Source: https://habr.com/ru/post/1614438/More articles:Разница между сеансом, HTTP-соединением? - httpExport function pointer from dll - cApache ProxyPass not working on OS X Yosemite - apacheОшибка Python: TypeError: getsockaddrarg: адрес AF_INET должен быть кортежем, а не int - pythonHow to set page title from partial page in MVC - c #NA-based data frame filtering on multiple columns - rhttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1614440/how-to-fix-my-webapi2-controllers-to-use-async-task-for-scability&usg=ALkJrhh_HFismgaGaqcoYMHiyB14g4mo-ADDD / CQRS: Combining Reading Models for User Interface Requirements - domain-driven-designкак справиться.. Флаг учетных данных - это "истинные" ошибки CORS - angularjsPullWait behavior in a Sub pub library? - goAll Articles