ASP Redirect

H

Harald Rønning

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


Using
ASP Redirect

<%@ 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
 
A

Anthony Jones

Harald Rønning said:
Hi
I´m trying to redirect using asp and found these exemple on
Internet


Using
ASP Redirect

<%@ 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.
 

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,769
Messages
2,569,582
Members
45,066
Latest member
VytoKetoReviews

Latest Threads

Top