Quantcast
Channel: Web Forms
Viewing all articles
Browse latest Browse all 23244

Dynamic Title Not Working Solution

$
0
0

I thought I would share my solution which I cobbled together from various posts.

Tried everything to set the page title dynamically for a page that has a master page.

Found a couple of posts when combined gave me this...

ASPX Page

<%@ Page Language="VB" MasterPageFile="~/site.master" AutoEventWireup="false" CodeFile="abc.aspx.vb" Inherits="abc" Title="Page Title" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">

        <title><%=Page.Title%></title>

</asp:Content>

VB Code

Page.Title = "ZZZZZZZZZZZ"

Master Page

<head runat="server">

      blah blah blah....
      <title visible="false" runat="server"></title>  <%--stops duplicate title tags--%>

      <asp:ContentPlaceHolder id="head" runat="server">
      </asp:ContentPlaceHolder>

</head>

Hope this is of use


Viewing all articles
Browse latest Browse all 23244

Trending Articles