In the code hellswraith posted, change the pound sign to an equals so it looks like this:
Code:
<title><%= strMyTitle %></title>
here's a working example:
PHP Code:
<script language="C#" runat="server">
private string _pageTitle = "";
public string PageTitle
{
get
{
return _pageTitle;
}
}
protected override void OnLoad(System.EventArgs e)
{
_pageTitle = "My Page Title";
}
</script>
<html>
<head>
<title><%= PageTitle %></title>
</head>
</html>
or you could do something like this:
PHP Code:
<script language="C#" runat="server">
protected override void OnLoad(System.EventArgs e)
{
PageTitle.InnerText = "My Page Title";
}
</script>
<html>
<head>
<title id="PageTitle" runat="server"/>
</head>
</html>
or if you wanna use code behind:
here's the html side of things:
Code:
<html>
<head>
<title id="PageTitle" runat="server"/>
</head>
</html>
and here's the code behind:
PHP Code:
public class Default : System.Web.UI.Page
{
protected HtmlGenericControl PageTitle;
protected override void OnInit(EventArgs e)
{
PageTitle.InnerText = "My Page Title";
}
}