Meta tag modification still doesn't work

  • Thread starter Maziar Aflatoun
  • Start date
M

Maziar Aflatoun

Hi,

I like to add content="10;url=http://www.google.com/" to my refresh tag.
The following still doesn't work. Can someone tell me please what I'm doing
wrong? (Note: It's not a new meta tag but an already existing one)

I have the following code
<HEAD>
<meta id="MyRefresh" http-equiv="refresh" runat="server"/>
</HEAD>


private HtmlGenericControl MyRefresh;

private void Page_Load(object sender, System.EventArgs e)
{
MyRefresh = new HtmlGenericControl("meta");
MyRefresh.ID = "MyRefresh";
MyRefresh.Attributes["content"] = "10;url=http://www.google.com/";
...

Thanks
Maz.
 
C

Craig Deelsnyder

Hi,

I like to add content="10;url=http://www.google.com/" to my refresh tag.
The following still doesn't work. Can someone tell me please what I'm
doing
wrong? (Note: It's not a new meta tag but an already existing one)

I have the following code
<HEAD>
<meta id="MyRefresh" http-equiv="refresh" runat="server"/>
</HEAD>


private HtmlGenericControl MyRefresh;

private void Page_Load(object sender, System.EventArgs e)
{
MyRefresh = new HtmlGenericControl("meta");
MyRefresh.ID = "MyRefresh";
MyRefresh.Attributes["content"] = "10;url=http://www.google.com/";
...

Thanks
Maz.

Don't initialize the control variable yourself; .NET will do that when it
sees the member level var. Take that line out (1st line in Page_Load)
 
C

Craig Deelsnyder

Hi,

I like to add content="10;url=http://www.google.com/" to my refresh tag.
The following still doesn't work. Can someone tell me please what I'm
doing
wrong? (Note: It's not a new meta tag but an already existing one)

I have the following code
<HEAD>
<meta id="MyRefresh" http-equiv="refresh" runat="server"/>
</HEAD>


private HtmlGenericControl MyRefresh;

private void Page_Load(object sender, System.EventArgs e)
{
MyRefresh = new HtmlGenericControl("meta");
MyRefresh.ID = "MyRefresh";
MyRefresh.Attributes["content"] = "10;url=http://www.google.com/";
...

Thanks
Maz.
Also just noticed, make the declaration protected HtmlGenericControl
MyRefresh, not private...this line should look just like the other
controls and how they're declared. It must be protected so the .aspx
links up w/ this var....
 
M

Maziar Aflatoun

Thank you. It worked :)

Maz.

Craig Deelsnyder said:
Hi,

I like to add content="10;url=http://www.google.com/" to my refresh tag.
The following still doesn't work. Can someone tell me please what I'm
doing
wrong? (Note: It's not a new meta tag but an already existing one)

I have the following code
<HEAD>
<meta id="MyRefresh" http-equiv="refresh" runat="server"/>
</HEAD>


private HtmlGenericControl MyRefresh;

private void Page_Load(object sender, System.EventArgs e)
{
MyRefresh = new HtmlGenericControl("meta");
MyRefresh.ID = "MyRefresh";
MyRefresh.Attributes["content"] = "10;url=http://www.google.com/";
...

Thanks
Maz.
Also just noticed, make the declaration protected HtmlGenericControl
MyRefresh, not private...this line should look just like the other
controls and how they're declared. It must be protected so the .aspx
links up w/ this var....
 
C

Craig Deelsnyder

Thank you. It worked :)

Maz.

not a problem, it's a little confusing, as it gets linked up like the
other control variables...and I usually can't remember the syntax for both
languages, so I rely on describing it :)
 

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

Similar Threads

Meta tag modification 1
Meta tags question 1
meta tag 1
Selecting CSS File From C# 1
I cant find my meta tag 2
concept of meta 1
META REFRESH 2
noscript adding dynamic meta tag 2

Top