By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,771 Members | 1,741 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,771 IT Pros & Developers. It's quick & easy.

IE Title......

P: n/a
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
Nov 18 '05 #1
Share this Question
Share on Google+
8 Replies


P: n/a
"Amir Sen" <Am*********@hotmail.com> wrote in news:ucY9Rb1lEHA.896
@TK2MSFTNGP12.phx.gbl:
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).


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

--
Lucas Tam (RE********@rogers.com)
Please delete "REMOVE" from the e-mail address when replying.
http://members.ebay.com/aboutme/coolspot18/
Nov 18 '05 #2

P: n/a
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" <RE********@rogers.com> wrote in message
news:Xn***************************@140.99.99.130.. .
"Amir Sen" <Am*********@hotmail.com> wrote in news:ucY9Rb1lEHA.896
@TK2MSFTNGP12.phx.gbl:
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).


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

--
Lucas Tam (RE********@rogers.com)
Please delete "REMOVE" from the e-mail address when replying.
http://members.ebay.com/aboutme/coolspot18/

Nov 18 '05 #3

P: n/a
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" <Am*********@hotmail.com> wrote in message
news:uc*************@TK2MSFTNGP12.phx.gbl...
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

Nov 18 '05 #4

P: n/a
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" <Am*********@hotmail.com> wrote in message
news:uc*************@TK2MSFTNGP12.phx.gbl...
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

Nov 18 '05 #5

P: n/a
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" <RE********@rogers.com> wrote in message
news:Xn***************************@140.99.99.130.. .
"Amir Sen" <Am*********@hotmail.com> wrote in news:ucY9Rb1lEHA.896
@TK2MSFTNGP12.phx.gbl:
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).


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

--
Lucas Tam (RE********@rogers.com)
Please delete "REMOVE" from the e-mail address when replying.
http://members.ebay.com/aboutme/coolspot18/

Nov 18 '05 #6

P: n/a
The opening title tag is missing the closing angular bracket '>' (after
"pgTitle").

"Amir Sen" <Am*********@hotmail.com> wrote in message
news:en**************@TK2MSFTNGP15.phx.gbl...
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" <RE********@rogers.com> wrote in message
news:Xn***************************@140.99.99.130.. .
"Amir Sen" <Am*********@hotmail.com> wrote in news:ucY9Rb1lEHA.896
@TK2MSFTNGP12.phx.gbl:
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).


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

--
Lucas Tam (RE********@rogers.com)
Please delete "REMOVE" from the e-mail address when replying.
http://members.ebay.com/aboutme/coolspot18/


Nov 18 '05 #7

P: n/a
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" <sh******@online.excite.com> wrote in message
news:uO**************@TK2MSFTNGP14.phx.gbl...
The opening title tag is missing the closing angular bracket '>' (after
"pgTitle").

"Amir Sen" <Am*********@hotmail.com> wrote in message
news:en**************@TK2MSFTNGP15.phx.gbl...
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" <RE********@rogers.com> wrote in message
news:Xn***************************@140.99.99.130.. .
"Amir Sen" <Am*********@hotmail.com> wrote in news:ucY9Rb1lEHA.896
@TK2MSFTNGP12.phx.gbl:
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).


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

--
Lucas Tam (RE********@rogers.com)
Please delete "REMOVE" from the e-mail address when replying.
http://members.ebay.com/aboutme/coolspot18/


Nov 18 '05 #8

P: n/a
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" <Am*********@hotmail.com> wrote in message
news:eo**************@TK2MSFTNGP15.phx.gbl...
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" <sh******@online.excite.com> wrote in message
news:uO**************@TK2MSFTNGP14.phx.gbl...
The opening title tag is missing the closing angular bracket '>' (after
"pgTitle").

"Amir Sen" <Am*********@hotmail.com> wrote in message
news:en**************@TK2MSFTNGP15.phx.gbl...
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" <RE********@rogers.com> wrote in message
news:Xn***************************@140.99.99.130.. .
"Amir Sen" <Am*********@hotmail.com> wrote in news:ucY9Rb1lEHA.896
@TK2MSFTNGP12.phx.gbl:

> 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).

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

--
Lucas Tam (RE********@rogers.com)
Please delete "REMOVE" from the e-mail address when replying.
http://members.ebay.com/aboutme/coolspot18/



Nov 18 '05 #9

This discussion thread is closed

Replies have been disabled for this discussion.