M
Maziar Aflatoun
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+TlnFX8=" />
</form>
</body>
</html>
<meta id="MyRefresh" http-equiv="refresh"
content="10;url=http://www.google.com/"></meta>Thank you
Maz.
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+TlnFX8=" />
</form>
</body>
</html>
<meta id="MyRefresh" http-equiv="refresh"
content="10;url=http://www.google.com/"></meta>Thank you
Maz.