Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Changing browser window's title via C#? or jscript?
Message
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
00870819
Message ID:
00871085
Vues:
16
Hi Neil,

To get
<META>
tags to show up in your HTML, you can use an embedded variable or function call:

Embedded Variable
// In the .aspx file:
<HTML>
<HEAD>
  <%= myMetaTagsVar%>     
</HEAD>
...

// In the code-behind file:
// create the following field
public string myMetaTagsVar = @"<META NAME=""Title"" content=""MyTitle"">";
Function Call
// In the .aspx file:
<HTML>
<HEAD>
  <%= GetMetaTagsFunction()%>     
</HEAD>
...

// In the code-behind file:
public string GetMetaTagsFunction()
{
   return @"<META NAME=""Title"" CONTENT=""MyTitle"">";
}
>Hi,
>
>I need to set the browser window's title just prior to the page being rendered or very soon afterwards. Is there a way to modify the contents of the TITLE tag pair dynamically. In classic asp I do something like this:
>
>
><title><%=myNewTitle  </title>
>
>
>But asp.net won't allow this sort of thing.
>
>Thanx,
>Neil
-----------------------------------------

Cathi Gero, CPA
Prenia Software & Consulting Services
Microsoft C# / .NET MVP
Mere Mortals for .NET MVP
cgero@prenia.com
www.prenia.com
Weblog: blogs.prenia.com/cathi
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform