We are attempting to add a HTML title to all the Index pages when they are loaded.
So in all the _Layout.cshtml
pages for the Default, Theme11 .... the code
@section Title{
@RenderSection("Title", true)
}
was added, then for each Index.html page the code
@section Title{
@L("Settings")
}
was added which works correctly.
We are having an issue with Theme8 which has a _Layout.cshtml
page with a different layout. So I get an exception since it finds a title in an Index page which shouldn't be there (because it isn't picking up the boolean switch).
Is this the correct way to achieve this ? Or is there a better method for added a title to each Index.html page ?
4 Answer(s)
-
0
What shouldn't be there? What boolean switch?
-
0
To get a custom HTML Title to any index page I need to add
RenderSection("Title", true)
to the_Layout.cshtml
pages. And thenTitle
to theIndex.cshtml
pages.If I don't add
RenderSection("Title", true)
to the_Layout.cshtml
page it give me nice exception error.We got all the pages loading except the Theme8
_Layout.cshtml
page is a LOT different to the others and we can't work out where to addRenderSection("Title", true)
So my question is either where do we add the
RenderSection("Title", true)
to the Theme8_Layout.cshtml
page, OR are we doing something we shouldn't and the framework handles custom titles and we just need to update the framework code ? -
0
I don't understand why you don't use ViewBag?
-
1
Again thanks for the keyword @maliming ! You guys are awesome so glad we bought this framework !
I will do some more research, keep in mind my knowledge is limited in some regards. On the plus side we are getting in a part time contractor to assist us with the more complicated problems.