Ok this an odd way of doing this, I know I should have done it on Page_Load in every pages when using Masterpage, but is there a way around this issue? I don't want to rebuild the pages if I can help it,if I can only insert a title on <asp:content></asp:content>
it would be easier.
If anyone has run into this or maybe have a suggestion of a good way to do it , I know jquery can do it document.title ='' but I heard it's not SEO friendly.
Thanks!
You can still set the title in each page that's using a MasterPage. In markup: -
<%@ Page Title="Your Title" Language="C#" MasterPageFile="~/_masterpages/... etc
Or in code: -
protected override void OnLoad(EventArgs e)
{
Page.Title = "Your Title";
base.OnLoad(e);
}
you can place a contentplaceholer in your master page as..
<asp:ContentPlaceHolder id="head" runat="server"> </asp:ContentPlaceHolder>
After that In content page add its reference as..
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
<title> Your title goes here. </title>
</asp:Content>
more simple solution in Master page <%: Page.Title %> - the main title goes here
in content page first line of it <%@ Page Title="Your Title" Language="C#" MasterPageFile="~/_masterpages/... etc
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With