Quantcast
Channel: ASP.NET Core
Viewing all articles
Browse latest Browse all 9386

Base View Page in ASP.NET MVC 6

$
0
0

Hello,

On ASP.NET MVC 5 I used a base ViewPage with a few properties:

public String PageTitle { get; set; }
public String PageDescription { get; set; }
public String[] BodyCssClasses { get; set; }

Then on each view I would have:

@{

    PageTitle = "Title ..."
    PageDescription" = "Description ..."
    BodyCssClasses = new String[] { "main", "home" }

}

On the master page I would simply use something like:

<title>@Title</title>

With this approach I was able to use Strong Typed for page properties ...

Is it possible to use a Base View Page in ASP.NET MVC 6?

Since there is no Web.Config how could this be done?

Any suggestions for better options to define page head info is welcome.

Thank You,

Miguel


Viewing all articles
Browse latest Browse all 9386

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>