noscript adding dynamic meta tag

D

Dst

<head runat="server">
<noscript>
<meta http-equiv='refresh' content='0;url=Unsupported.htm'/>
</noscript>
</head>


If i add this to my webform, it redirects to Unsupported.htm if
javascript is disabled.

But i'm trying to make a utility class that will add this code
serverside.
Is it possible to add this to the resonse header server side:
<noscript>
<meta http-equiv='refresh' content='0;url=Unsupported.htm'/>
</noscript>

I have only seen exampes like this:
Response.AppendHeader("Refresh", "0; url=Unsupported.htm");
But this of course always redirects, because it has no noscript tags.
Not sure how i can add this with noscript tags..

Anyone ?
 
S

Siva M

Here is one way:

Declare a protected class-level string var as:
protected string noScriptTag = "<noscript><meta http-equiv=\"refresh\"
content=\"0;a.htm\" /></noscript>";

In the .aspx have:

<html>
<head runat="server">
<%= noScriptTag %>
<title>Untitled Page</title>
.... ...

Hope this helps?

<head runat="server">
<noscript>
<meta http-equiv='refresh' content='0;url=Unsupported.htm'/>
</noscript>
</head>


If i add this to my webform, it redirects to Unsupported.htm if
javascript is disabled.

But i'm trying to make a utility class that will add this code
serverside.
Is it possible to add this to the resonse header server side:
<noscript>
<meta http-equiv='refresh' content='0;url=Unsupported.htm'/>
</noscript>

I have only seen exampes like this:
Response.AppendHeader("Refresh", "0; url=Unsupported.htm");
But this of course always redirects, because it has no noscript tags.
Not sure how i can add this with noscript tags..

Anyone ?
 

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,755
Messages
2,569,534
Members
45,008
Latest member
Rahul737

Latest Threads

Top