c# - ViewBag.Title not working in my code ASP.NET MVC 4 -
i new visual studio , having difficulty making viewbag.title function correctly.
here code viewbag.title not working , gettin printed on screen in incorrect position , full string "viewbag.title = "home page";"
@model ienumerable<employees.models.employee> @{webgrid grid = new webgrid(model);} { viewbag.title = "home page"; } @section featured { <section class="featured"> <div class="content-wrapper"> <hgroup class="title"> <h1>@viewbag.title.</h1> <h2>@viewbag.message</h2> </hgroup> @grid.gethtml(columns: new[] { .... ....
i'm pretty sure need prefix code block assign viewbag.title
@
@{ viewbag.title = "home page"; }
this rendering straight html
Comments
Post a Comment