Ayuda con If y Redirect
Publicado por Niki (1 intervención) el 20/07/2001 17:13:28
Tengo problemas con el Response.Redirect y el If. Trato de desplegar la mejor version de una pagina asp dependiendo del idioma del browser cliente. Este es el codigo, digame alguien que hago mal por favor.
<% Option Explicit %>
<html>
<head><title>Probando en diferentes idiomas</title></head>
<body>
<%
Dim info
set info = Server.CreateObject("MSWC.BrowserType")
%>
<% dim A,B
A = Request.Servervariables("http_accept_language")
B = Left(A,2)
Response.Write B
If B = "es" Then
Response.Redirect("espanol.html")
Else If B = "en" Then
Response.Redirect("english.html")
Else if B = "fr" Then
Response.Redirect("francais.html")
Else Response.Redirect("cual.html")
End If
End If
End If
%>
</body>
</html>
Trate de hacerlo con el Case, pero tampoco me sirve.
<% Option Explicit %>
<html>
<head><title>Probando en diferentes idiomas</title></head>
<body>
<%
Dim info
set info = Server.CreateObject("MSWC.BrowserType")
%>
<% dim A,B
A = Request.Servervariables("http_accept_language")
B = Left(A,2)
Response.Write B
If B = "es" Then
Response.Redirect("espanol.html")
Else If B = "en" Then
Response.Redirect("english.html")
Else if B = "fr" Then
Response.Redirect("francais.html")
Else Response.Redirect("cual.html")
End If
End If
End If
%>
</body>
</html>
Trate de hacerlo con el Case, pero tampoco me sirve.
Valora esta pregunta


0