Dynamic Refresh using meta tags????

G

Guest

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)
 
P

Patrice

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
 
G

Guest

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
 
V

vMike

Tim::.. said:
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
 
G

Guest

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)"
 

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

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,525
Members
44,997
Latest member
mileyka

Latest Threads

Top