I am writing an MVC C # application. I use masterpage and have the title and content of other pages placed in contentPlaceholders that appear on the main page.
In MasterPage, I want the TitleContent to be written both in the <title> tag and in the <body> (in the <h1> tag).
I am not allowed to do this because for some strange reason you are not allowed to use the same contentPlaceholder twice on the page.
Until now, I used
(FindControl("TitleContent").Controls[0] as LiteralControl).Text
a <h1> tag that worked fine until I started adding dynamic content to the TitleContent placeholder (like C # code).
How to display this content twice?
source
share