R Rocky Moore Jan 13, 2004 #2 SOS said: Hi guys , how can i change the page title in the run time ? Thanx Click to expand... You can add an ID and a RunAt="Server" to your title tag and in the code behind refer to it by: protected System.Web.UI.HtmlControls.HtmlGenericControl myTitleTag; and in your code: myTitleTag.InnerHTML = "Oh, Boy Page"; Another option to access the data directly on the aspx page in <% %> in the<Title> tag.
SOS said: Hi guys , how can i change the page title in the run time ? Thanx Click to expand... You can add an ID and a RunAt="Server" to your title tag and in the code behind refer to it by: protected System.Web.UI.HtmlControls.HtmlGenericControl myTitleTag; and in your code: myTitleTag.InnerHTML = "Oh, Boy Page"; Another option to access the data directly on the aspx page in <% %> in the<Title> tag.
S Shiv Kumar Jan 13, 2004 #3 You could declare a property in your page class and then have it automatically replaced when the databind method of the page is called. So the Page's property could be declared like so: private string theTitle; protected string TheTitle { get { return theTitle; } } // At some point while processing your page you set the property (using the private variable) and in your .aspx page you could have <title><%# TheTitle %></title>
You could declare a property in your page class and then have it automatically replaced when the databind method of the page is called. So the Page's property could be declared like so: private string theTitle; protected string TheTitle { get { return theTitle; } } // At some point while processing your page you set the property (using the private variable) and in your .aspx page you could have <title><%# TheTitle %></title>