Monday 7 April 2014

MVC5 - How to change page title


Watch this example on YouTube:
Add the following code to cshtml file (inside Views folder)
@{
       ViewBag.Title = "this is my title";
}

this works because my layout page has the following code:
 <title>@ViewBag.Title - My ASP.NET Application</title>

No comments:

Post a Comment