IE Title......
Messages   Related Types
This message was discovered on microsoft.public.dotnet.framework.aspnet.

Post a new message to this list...

Amir Sen
Is it possible to dynamically change the IE title? After subsequent post
back of the same page I would like to change the IE title which is to be
read from a server side control (TextBox).

Thanks,

Amir

Reply to this message...
 
    
Karl
I've always used

<title id="title" runat="server" />

codebehind:

protected HtmlGenericControl title;

void page_load(...){

title.innerText = "blah";
}

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/

"Amir Sen" <Click here to reveal e-mail address> wrote in message
news:Click here to reveal e-mail address...
[Original message clipped]

Reply to this message...
 
    
Shiva
Hi,
Here is one way to do it: Give the title tag an id and add runat=server
attribute. Then access it from the code-behind using its id.

<title runAt=server id="pgTitle"></title>

From code behid:
pgTitle.InnerText = TextBox.Text;

"Amir Sen" <Click here to reveal e-mail address> wrote in message
news:Click here to reveal e-mail address...
Is it possible to dynamically change the IE title? After subsequent post
back of the same page I would like to change the IE title which is to be
read from a server side control (TextBox).

Thanks,

Amir

Reply to this message...
 
    
Lucas Tam
"Amir Sen" <Click here to reveal e-mail address> wrote in news:ucY9Rb1lEHA.896
@TK2MSFTNGP12.phx.gbl:

[Original message clipped]

Place a literal or label control in the <title></title> area of the
webpage.

--
Lucas Tam (Click here to reveal e-mail address)
Please delete "REMOVE" from the e-mail address when replying.
http://members.ebay.com/aboutme/coolspot18/
Reply to this message...
 
    
Amir Sen
Now I am getting the following error message.

The server tag is not well formed.

Below are the codes.

HTML Code:
<title runat = "server" id="pgTitle"</title>

Code behind Code
Protected pgTitle As HtmlGenericControl

In the Page_Load event,
pgTitle.InnerText = txtCityName.Text

What is wrong with this code?
Thanks,
Amir

"Lucas Tam" <Click here to reveal e-mail address> wrote in message
news:Xns956086B99E64Dnntprogerscom@140.99.99.130...
[Original message clipped]

Reply to this message...
 
    
Shiva
The opening title tag is missing the closing angular bracket '>' (after
"pgTitle").

"Amir Sen" <Click here to reveal e-mail address> wrote in message
news:Click here to reveal e-mail address...
Now I am getting the following error message.

The server tag is not well formed.

Below are the codes.

HTML Code:
<title runat = "server" id="pgTitle"</title>

Code behind Code
Protected pgTitle As HtmlGenericControl

In the Page_Load event,
pgTitle.InnerText = txtCityName.Text

What is wrong with this code?
Thanks,
Amir

"Lucas Tam" <Click here to reveal e-mail address> wrote in message
news:Xns956086B99E64Dnntprogerscom@140.99.99.130...
[Original message clipped]

Reply to this message...
 
    
Amir Sen
Thanks for the suggestion on my Syntax error.
However my original problem still not resolved.

Here is my Code
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
If Not IsPostBack Then

'Load the data from database

pgTitle.InnerText = txtCityName.Text 'Works fine at this step

else

'User do city search

pgTitle.InnerText = txtCityName.Text 'Even though
pgTitle.InnerText is getting populated with the latest city name Title is
not reflecting the latest name

end if

End Sub

Thanks for your reply.
Amir

"Shiva" <Click here to reveal e-mail address> wrote in message
news:Click here to reveal e-mail address...
[Original message clipped]

Reply to this message...
 
    
Amir Sen
I had kept SmartNavigation = true for the page. Thats the reason title is
not getting refreshed after postbak. But anyone has any solution to this
problem with smartnavigation = true.
Thanks,
Gireesha

"Amir Sen" <Click here to reveal e-mail address> wrote in message
news:Click here to reveal e-mail address...
[Original message clipped]

Reply to this message...
 
    
Amir Sen
Lucas,
I have the followinf code.
<title>
<% = txtCityName.Text %>
</title>

When the page loaded first time the city name is appearing in the title bar.
If the user changes the CityName(by search), search will resubmit the page
again and replaces the server side control(textbox) text property with the
latest city name search.
Title is not getting refreshed.
Thanks for your suggestions.
Gireesha

"Lucas Tam" <Click here to reveal e-mail address> wrote in message
news:Xns956086B99E64Dnntprogerscom@140.99.99.130...
[Original message clipped]

Reply to this message...
 
 
System.EventArgs
System.Object
System.Web.UI.HtmlControls.HtmlGenericControl
System.Web.UI.MobileControls.TextBox
System.Web.UI.WebControls.TextBox
System.Windows.Forms.TextBox




Ad
MBR BootFX
Best-of-breed application framework for .NET projects, developed by Matthew Baxter-Reynolds and MBR IT
 
 Copyright © Matthew Baxter-Reynolds 2001-2008. '.NET 247 Software Development Services' is a trading style of MBR IT Solutions Ltd.
Contact Us - Terms of Use - Privacy Policy - www.dotnet247.com