how to change title of aspx page dynamically on page load
You can do this:
Set the aspx header something like this
<HEAD>
<TITLE ID=CaptionHere RUNAT="server"></TITLE>
</HEAD>
And in code behind put this inside the page load event:
if(!IsPostBack)
{
myCaption.InnerHtml = "Hope this works!"
}
I hope this will help you
If this is classic ASP.NET (not MVC) and you are using MasterPage
then you can set default title in Page_Load
event in MasterPage
:
protected void Page_Load(object sender, EventArgs e)
{
if (string.IsNullOrEmpty(Page.Title))
{
Page.Title = ConfigurationManager.AppSettings["DefaultTitle"]; //title saved in web.config
}
}