ASP Redirect

Hi
I´m trying to redirect using asp and found these exemple on
Internet


Using
ASP Redirect

<% [at] Language=VBScript %>
<%
Response.Status="301 Moved Permanently";
Response.AddHeader("Location","http://mygoodstart.com/");
%>

I got this error:


Microsoft VBScript compilation error '800a0401'

Expected end of statement

/index.asp, line 3
Response.Status="301 Moved Permanently";
---------------------------------------^



Using

ASP .NET Redirect

<script runat="server">
private void Page_Load(object sender, System.EventArgs e)
{
Response.Status = "301 Moved Permanently";
Response.AddHeader("Location","http://mygoodstart.com");
}
</script>


I got this error


Active Server Pages error 'ASP 0124'

Missing Language attribute

/index.asp, line 1

The required Language attribute of the Script tag is missing.


Can somebody please help me to get one of them to work


Regards

Harald
stroenni [ Do, 23 August 2007 00:24 ] [ ID #1802327 ]

Re: ASP Redirect

"Harald Rønning" <stroenni [at] c2i.net> wrote in message
news:op.txhe68u8w8vl1z [at] sten...
>
> Hi
> I´m trying to redirect using asp and found these exemple on
> Internet
>
>
> Using
> ASP Redirect
>
> <% [at] Language=VBScript %>
> <%
> Response.Status="301 Moved Permanently";
> Response.AddHeader("Location","http://mygoodstart.com/");
> %>
>

Response.AddHeader "Location", "http://mygoodstart.com/"

Don't put ; on the end of VBScript lines and don't use parentheses on method
calls that are not returning a value.


--
Anthony Jones - MVP ASP/ASP.NET
Anthony Jones [ Do, 23 August 2007 13:11 ] [ ID #1803193 ]
Webserver » microsoft.public.inetserver.asp.general » ASP Redirect

Vorheriges Thema: Multi-dimensional arrays - (I think!)
Nächstes Thema: payment gateway