473,382 Members | 1,766 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

IE Title......

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
8 1428
"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
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
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
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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: the wonderer | last post by:
This is an elementary question, but I've not been able to find the answer, so here goes: I am developing a site using php. I have the html header information in a file that I include in all the...
13
by: mark | last post by:
IF I have something like this: <title><?php print($pagetitle); ?></title> <body> <?php include("folders/my_include.php"); ?> </body> </html> and my_include.php contains the value to the...
5
by: Info 3000 | last post by:
Hi there, Simple question, but headache ! I have a PHP Page like : <HTML> <HEAD> <TITLE>Sunny day !</TITLE> </HEAD>
6
by: Don Grover | last post by:
How can I get the page title into an variable to handle in my asp. Don
9
by: Ian Renfrew | last post by:
Essentially, I want to prevent the display of the Microsoft Internet Explorer or any other branding tag in the document title. One technique that I've used is to insert multiple spaces after the...
3
by: Andy Dingley | last post by:
We've all seen this structure many times: <ul> <li><a href="..." >Click here</a></li> <li><a href="..." >Click here</a></li> </ul> Now it's obvious good practice to have sensible link texts,...
4
by: laredotornado | last post by:
Hello, How do I use Javasript to get the <TITLE> element of a web page? If anyone can supply a cross browser way (IE 5.5+, Firefox 1+), it is most appreciated. Dave
5
by: Maxim Izbrodin | last post by:
Hello For displaying page titles for my ASP.NET applications I use the following technique <title><%=BannerModule.PageTitle%></title where BannerModule.PageTitle is a public field of my user...
14
by: Paul | last post by:
I want to set the page title and/or a form hidden field programatically through ASP.Net. I do not want to use something like... <% sTitle ="My Title" %> <html><title><%=sTitle%></title>..... ...
6
by: vijai.kalyan | last post by:
Hello, I wrote a trivial program to set the console title in a console application. Here is the code:- namespace myns { class SetTitle { static void Main ( string args )
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.