Connecting Tech Pros Worldwide Forums | Help | Site Map

Meta tag modification

Maziar Aflatoun
Guest
 
Posts: n/a
#1: Nov 18 '05
Hi everyone,

My goal is to modify the contents of my meta tag (html refresh). However,
my code adds a new instance of the meta tag at the bottom of the page. Is
there a way to modify it instead of adding a new one?

<head>
<title>WebForm1</title>
<meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1">
<meta name="CODE_LANGUAGE" Content="C#">
<meta name=vs_defaultClientScript content="JavaScript">
<meta name=vs_targetSchema
content="http://schemas.microsoft.com/intellisense/ie5">
<meta id="MyRefresh" http-equiv="refresh" runat="server" />
</head>

Code:
private HtmlGenericControl baseDescription;

private void Page_Load(object sender, System.EventArgs e)
{
// Put user code to initialize the page here
baseDescription = new HtmlGenericControl("meta");
baseDescription.ID = "MyRefresh";
baseDescription.Attributes["http-equiv"] = "refresh";
baseDescription.Attributes["content"] = "10;url=http://www.google.com/";
this.Controls.Add(baseDescription);
}

It produces this
<html>
<head>
<title>WebForm1</title>
<meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1">
<meta name="CODE_LANGUAGE" Content="C#">
<meta name=vs_defaultClientScript content="JavaScript">
<meta name=vs_targetSchema
content="http://schemas.microsoft.com/intellisense/ie5">
<meta id="MyRefresh" http-equiv="refresh"></meta>
</head>
<body MS_POSITIONING="GridLayout">
<form name="Form1" method="post" action="WebForm1.aspx" id="Form1">
<input type="hidden" name="__VIEWSTATE"
value="dDwyMDQ4ODY2NTc4Ozs+TOEvvBKAHbIZ9zIwcQpj+Tl nFX8=" />


</form>
</body>
</html>
<meta id="MyRefresh" http-equiv="refresh"
content="10;url=http://www.google.com/"></meta>Thank you
Maz.



Lucas Tam
Guest
 
Posts: n/a
#2: Nov 18 '05

re: Meta tag modification


"Maziar Aflatoun" <maz00@rogers.com> wrote in news:G5LRc.1605$Bpa1.1223
@news04.bloor.is.net.cable.rogers.com:
[color=blue]
> Is
> there a way to modify it instead of adding a new one?
>[/color]

You can place a label or place holder in the meta tag, then output data to
the placeholder or label.

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