A simple question

G

Guest

Hi All!
How do you control what's in the blue title bar in IE. Like for example
"Discussions in dotnet.framework.aspnet - Microsoft Internet Explorer" on
this page. Where do you controll the text for that on a web page?

Thanks!

Rudy
 
M

Mark

Hi, it's the title attribute of a document.

You can dynamically set the information in the title by making it a server
side control ala

<TITLE runat="server" id="PageTitle">Old page title</TITLE>

and then in the code behind...

[vbcode]
CType(Page.FindControl("PageTitle"),
System.Web.UI.HtmlControls.HtmlGenericControl).InnerText = "This is a new
title"
[/vbcode]

hth
Cheers
Mark
 
G

Guest

this is the better answer!
thanks
kes

Mark said:
Hi, it's the title attribute of a document.

You can dynamically set the information in the title by making it a server
side control ala

<TITLE runat="server" id="PageTitle">Old page title</TITLE>

and then in the code behind...

[vbcode]
CType(Page.FindControl("PageTitle"),
System.Web.UI.HtmlControls.HtmlGenericControl).InnerText = "This is a new
title"
[/vbcode]

hth
Cheers
Mark

Rudy said:
Hi All!
How do you control what's in the blue title bar in IE. Like for example
"Discussions in dotnet.framework.aspnet - Microsoft Internet Explorer" on
this page. Where do you controll the text for that on a web page?

Thanks!

Rudy
 
J

Juan T. Llibre

An answer which, of course, begs the question that :

"If you are manually changing the title in code, wouldn't
it be simpler just to change the title in the aspx page?"

The concept of needing code in order to do a
simple html title change is a bit thick for me.

Now, if you were doing the change dynamically, so that the
new title better fitted a different page content, I'd see the
advantage.

As it is, the code only adds cumbersomeness.






Kurt Schroeder said:
this is the better answer!
thanks
kes

Mark said:
Hi, it's the title attribute of a document.

You can dynamically set the information in the title by making it a server
side control ala

<TITLE runat="server" id="PageTitle">Old page title</TITLE>

and then in the code behind...

[vbcode]
CType(Page.FindControl("PageTitle"),
System.Web.UI.HtmlControls.HtmlGenericControl).InnerText = "This is a new
title"
[/vbcode]

hth
Cheers
Mark

Rudy said:
Hi All!
How do you control what's in the blue title bar in IE. Like for example
"Discussions in dotnet.framework.aspnet - Microsoft Internet Explorer" on
this page. Where do you controll the text for that on a web page?

Thanks!

Rudy
 
M

Mark

I agree wholeheartly, if it can be done with a simple piece of HTML then use
that. The example I gave was just in case the original poster wanted to
change the title dynamically :)

I have seen too many instances of people using ASP.NET controls when a
straight HTML control would do the job tider, better. E.g people
implementing a asp.net linkbutton and then in the click event redirecting to
a page. A much tider, better solution would be to use the old <a
href="http://sadsadsad

Cheers
Mark




Juan T. Llibre said:
An answer which, of course, begs the question that :

"If you are manually changing the title in code, wouldn't
it be simpler just to change the title in the aspx page?"

The concept of needing code in order to do a
simple html title change is a bit thick for me.

Now, if you were doing the change dynamically, so that the
new title better fitted a different page content, I'd see the
advantage.

As it is, the code only adds cumbersomeness.






this is the better answer!
thanks
kes

Mark said:
Hi, it's the title attribute of a document.

You can dynamically set the information in the title by making it a server
side control ala

<TITLE runat="server" id="PageTitle">Old page title</TITLE>

and then in the code behind...

[vbcode]
CType(Page.FindControl("PageTitle"),
System.Web.UI.HtmlControls.HtmlGenericControl).InnerText = "This is a new
title"
[/vbcode]

hth
Cheers
Mark

Hi All!
How do you control what's in the blue title bar in IE. Like for example
"Discussions in dotnet.framework.aspnet - Microsoft Internet Explorer" on
this page. Where do you controll the text for that on a web page?

Thanks!

Rudy
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top