asp.net mvc - What is ViewBag.Title in Razor? -
asp.net mvc - What is ViewBag.Title in Razor? -
what viewbag.title
in asp.net mvc 4?
i have view file:
@model ienumerable<mvcmusicstore.models.genre> @{ viewbag.title = "store"; } <h2>index</h2>
and not know changing viewbag.title
may accomplish.
from asp.net site:
viewbag dynamic object, means can set whatever want in it; viewbag object has no defined properties until set within it.
the viewbag.title
property string object. in case it's beingness used in view define title
property. if in _layout.cshtml
file see like:
<title>@viewbag.title</title>
remember when property defined in view? when page rendered, property ends in html markup looking like:
<title>store</title>
which sets browser title.
asp.net-mvc razor
Comments
Post a Comment