473,413 Members | 1,757 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,413 software developers and data experts.

Meta tag modification still doesn't work

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.
Nov 18 '05 #1
4 1124
On Mon, 09 Aug 2004 15:03:29 GMT, Maziar Aflatoun <ma***@rogers.com> wrote:
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)

--
Craig Deelsnyder
Microsoft MVP - ASP/ASP.NET
Nov 18 '05 #2
On Mon, 09 Aug 2004 15:03:29 GMT, Maziar Aflatoun <ma***@rogers.com> wrote:
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....
--
Craig Deelsnyder
Microsoft MVP - ASP/ASP.NET
Nov 18 '05 #3
Thank you. It worked :)

Maz.

"Craig Deelsnyder" <cdeelsny@no_spam_4_meyahoo.com> wrote in message
news:opscg052jl75dg5d@nrt-orezj2k87bn...
On Mon, 09 Aug 2004 15:03:29 GMT, Maziar Aflatoun <ma***@rogers.com>
wrote:
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....
--
Craig Deelsnyder
Microsoft MVP - ASP/ASP.NET

Nov 18 '05 #4
On Mon, 09 Aug 2004 15:56:50 GMT, Maziar Aflatoun <ma***@rogers.com> wrote:
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 :)

--
Craig Deelsnyder
Microsoft MVP - ASP/ASP.NET
Nov 18 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Carlo v. Dango | last post by:
hello there I'd like to take control over the method dispatching of every subclass of a given python class. Currently I've redefined __getattribute__() so i can find the right instance/method to...
0
by: Maziar Aflatoun | last post by:
Hi, I like to add content="10;url=http://www.google.com/" to my refresh tag. The following still doesn't work. Can someone please tell me what I'm doing wrong? (Note: It's not a new meta tag but...
4
by: Jim Hammond | last post by:
After much effort, it doesn't seem possible to redirect the user to a new page after 10 seconds by using a server-side timer. I am now using the following meta statement to accomplish the same...
1
by: Maziar Aflatoun | last post by:
Hi everyone, I have the following HTML code and I like to change the value of REFRESH content from 2 to something else at runtime. Any suggestions? <HTML> <HEAD> <meta name="GENERATOR"...
1
by: Maziar Aflatoun | last post by:
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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.