By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,212 Members | 2,209 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,212 IT Pros & Developers. It's quick & easy.

Dynamic Refresh using meta tags????

P: n/a
Can someone please tell me why the following dynamic refresh doesn't work!

Thanks

Inline code...
<!----- dynamically filled META REFRESH element ----->
<meta id="mtaRefresh" runat="server" />
...CodeBehind
Protected WithEvents mtaRefresh As
System.Web.UI.HtmlControls.HtmlGenericControl
' use META REFRESH to start loading next page
mtaRefresh.Attributes.Add("http-equiv", "refresh")
mtaRefresh.Attributes.Add("content", "0;url=" & sRefreshURL)
Nov 19 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Start by checking the HTML code using "view source" to find out if this is
a problem with creating the HTML server side or how the browser behaves
client-side. If the HTML looks good try a non zero value...

Patrice

--

"Tim::.." <myatix_at_hotmail.com> a écrit dans le message de
news:22**********************************@microsof t.com...
Can someone please tell me why the following dynamic refresh doesn't work!

Thanks

Inline code...
<!----- dynamically filled META REFRESH element ----->
<meta id="mtaRefresh" runat="server" />
..CodeBehind
Protected WithEvents mtaRefresh As
System.Web.UI.HtmlControls.HtmlGenericControl
' use META REFRESH to start loading next page
mtaRefresh.Attributes.Add("http-equiv", "refresh")
mtaRefresh.Attributes.Add("content", "0;url=" & sRefreshURL)

Nov 19 '05 #2

P: n/a
I think I'm using the wrong namespace but I'm not sure what it should be! I
would be grateful for any advice!

I checked the HTML source and the code isn't generated!

Can someone please help!

Inlinecode...
<!----- dynamically filled META REFRESH element ----->
<meta id="mtaRefresh" runat="server" />

Codebehind...
Protected WithEvents mtaRefresh As
System.Web.UI.HtmlControls.HtmlGenericControl

mtaRefresh.Attributes.Add("http-equiv", "refresh")
mtaRefresh.Attributes.Add("content", "0;url=" & sRefreshURL)
Thank you!


Protected WithEvents tagBody As System.Web.UI.HtmlControls.HtmlGenericControl

"Patrice" wrote:
Start by checking the HTML code using "view source" to find out if this is
a problem with creating the HTML server side or how the browser behaves
client-side. If the HTML looks good try a non zero value...

Patrice

--

"Tim::.." <myatix_at_hotmail.com> a écrit dans le message de
news:22**********************************@microsof t.com...
Can someone please tell me why the following dynamic refresh doesn't work!

Thanks

Inline code...
<!----- dynamically filled META REFRESH element ----->
<meta id="mtaRefresh" runat="server" />
..CodeBehind
Protected WithEvents mtaRefresh As
System.Web.UI.HtmlControls.HtmlGenericControl
' use META REFRESH to start loading next page
mtaRefresh.Attributes.Add("http-equiv", "refresh")
mtaRefresh.Attributes.Add("content", "0;url=" & sRefreshURL)


Nov 19 '05 #3

P: n/a

"Tim::.." <myatix_at_hotmail.com> wrote in message
news:22**********************************@microsof t.com...
Can someone please tell me why the following dynamic refresh doesn't work!

Thanks

Inline code...
<!----- dynamically filled META REFRESH element ----->
<meta id="mtaRefresh" runat="server" />
..CodeBehind
Protected WithEvents mtaRefresh As
System.Web.UI.HtmlControls.HtmlGenericControl
' use META REFRESH to start loading next page
mtaRefresh.Attributes.Add("http-equiv", "refresh")
mtaRefresh.Attributes.Add("content", "0;url=" & sRefreshURL)


I may be wrong, but I didn't think you can use runat with a meta tag. What I
do is create a placeholder and place literal or load static controls in the
placeholder as follows.

Adding literal
plc1.controls.clear
plc1.controls.add(New Literalcontrol("<meta name=" & chr(34) & "my meta
string" & chr(34) & " content=" & chr(34) & "content text" & chr(34) & ">"))

or if you have several fixed meta controls that you can add depending on
criteria.
plc1.controls.clear
dim ctl as control = loadcontrol("inc/metatag123.ascx")
plc1.controls.add(ctl)

Hope this helps.
Mike


Nov 19 '05 #4

P: n/a
Tim,

another way of accomplishing this, is using javascript, generated serverside.
Now I didn't test this actual line of code but I've used it before

Page.RegisterStartUpScript("Refresh", myScript)

where myScript contains:
string myScript = "window.SetInterval(document.location.reload,
some_variable_containing_milliseconds)"
"Tim::.." wrote:
I think I'm using the wrong namespace but I'm not sure what it should be! I
would be grateful for any advice!

I checked the HTML source and the code isn't generated!

Can someone please help!

Inlinecode...
<!----- dynamically filled META REFRESH element ----->
<meta id="mtaRefresh" runat="server" />

Codebehind...
Protected WithEvents mtaRefresh As
System.Web.UI.HtmlControls.HtmlGenericControl

mtaRefresh.Attributes.Add("http-equiv", "refresh")
mtaRefresh.Attributes.Add("content", "0;url=" & sRefreshURL)
Thank you!


Protected WithEvents tagBody As System.Web.UI.HtmlControls.HtmlGenericControl

"Patrice" wrote:
Start by checking the HTML code using "view source" to find out if this is
a problem with creating the HTML server side or how the browser behaves
client-side. If the HTML looks good try a non zero value...

Patrice

--

"Tim::.." <myatix_at_hotmail.com> a écrit dans le message de
news:22**********************************@microsof t.com...
Can someone please tell me why the following dynamic refresh doesn't work!

Thanks

Inline code...
<!----- dynamically filled META REFRESH element ----->
<meta id="mtaRefresh" runat="server" />
..CodeBehind
Protected WithEvents mtaRefresh As
System.Web.UI.HtmlControls.HtmlGenericControl
' use META REFRESH to start loading next page
mtaRefresh.Attributes.Add("http-equiv", "refresh")
mtaRefresh.Attributes.Add("content", "0;url=" & sRefreshURL)


Nov 19 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.