Connecting Tech Pros Worldwide Forums | Help | Site Map

Meta tag modification still doesn't work

Maziar Aflatoun
Guest
 
Posts: n/a
#1: Nov 18 '05
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.


Craig Deelsnyder
Guest
 
Posts: n/a
#2: Nov 18 '05

re: Meta tag modification still doesn't work


On Mon, 09 Aug 2004 15:03:29 GMT, Maziar Aflatoun <maz00@rogers.com> wrote:
[color=blue]
> 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.
>
>[/color]

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
Craig Deelsnyder
Guest
 
Posts: n/a
#3: Nov 18 '05

re: Meta tag modification still doesn't work


On Mon, 09 Aug 2004 15:03:29 GMT, Maziar Aflatoun <maz00@rogers.com> wrote:
[color=blue]
> 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.
>
>[/color]
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
Maziar Aflatoun
Guest
 
Posts: n/a
#4: Nov 18 '05

re: Meta tag modification still doesn't work


Thank you. It worked :)

Maz.

"Craig Deelsnyder" <cdeelsny@no_spam_4_meyahoo.com> wrote in message
news:opscg052jl75dg5d@nrt-orezj2k87bn...[color=blue]
> On Mon, 09 Aug 2004 15:03:29 GMT, Maziar Aflatoun <maz00@rogers.com>
> wrote:
>[color=green]
>> 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.
>>
>>[/color]
> 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[/color]


Craig Deelsnyder
Guest
 
Posts: n/a
#5: Nov 18 '05

re: Meta tag modification still doesn't work


On Mon, 09 Aug 2004 15:56:50 GMT, Maziar Aflatoun <maz00@rogers.com> wrote:
[color=blue]
> Thank you. It worked :)
>
> Maz.[/color]

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
Closed Thread


Similar ASP.NET bytes