Base solution for your next web application
Ends in:
01 DAYS
01 HRS
01 MIN
01 SEC
Open Closed

Page Title via Menu/Navigation #3461


User avatar
0
blewis created

The Zero Template comes with the _layout.cshtml file containing a hardcoded page title (title tag). Is there an easy/built-in way to make the name of the active menu/nav item the page title? I have looked through the docs and I don't see anything.


4 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @blewis,

    Which version do you use ? Angular1, Angular2, ASP.NET MVC 5.x & jQuery or ASP.NET Core & jQuery ?

    Thanks.

  • User Avatar
    0
    blewis created

    Sorry, ASP.NET Core & jQuery. (Zero version 4.1.1 -- just downloaded).

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    Then, you can use "<title>@ViewBag.CurrentPageName</title>". But there might be some pages which we didn't set ViewBag.CurrentPageName, you might need to handle that case.

    Thanks.

  • User Avatar
    0
    blewis created

    Thanks!