I am working on MVC 5 application. In that I need to display the name of the application in every page, that name is coming from database. one of the view display correctly but its not working in other views.
I am using like this
@Html.DisplayFor(model => model.app_name, new { name = ViewData["Appname"] })
this is working only in one view, not all other views.
the table columns are not display as expected after this model => model.
how to display the name of the application in all views
Thanks,
Loading
keyurPosted Feb 10, 2015, 12:26 AM
In MVC we have _Layout.cshtml file which work as master page in asp.net.So add _Layout file in shared folder and put there your common things to show in all views.
Like in asp.net we have contentplaceholder here we have RendarBody.
So use _Layout file and include in your view.
http://www.w3schools.com/aspnet/mvc_layout.asp
this will help you,
Manish Kumar ChoudharyPosted Jan 30, 2015, 9:50 PM