How can I redirect

Discussion in 'ASP General' started by Jack, Dec 4, 2003.

  1. Jack

    Jack Guest

    Hello,
    I wrote this code:
    <%@ LANGUAGE=VBScript %>
    <%
    Response.Write "<INPUT id=button11 name=button11 type=button value=Button11
    LANGUAGE=vbscript onclick=""abcd()"">"
    Response.Write "<BR>"
    %>
    <SCRIPT Language=VBScript>
    function abcd()
    Response.Redirect("http://192.168.1.31")
    end function
    </SCRIPT>

    But when click button11,can't redirect.
    Can you help me
     
    Jack, Dec 4, 2003
    #1
    1. Advertising

  2. Jack

    Ken Schaefer Guest

    Response.Redirect is a server-side function. You can't call that in
    client-side code.

    You need to use javascript on the client.

    <script type="text/javascript">
    function abcd() {
    document.location.href='newpage.asp'
    }
    </script>

    Cheers
    Ken


    "Jack" <> wrote in message
    news:eG23$...
    : Hello,
    : I wrote this code:
    : <%@ LANGUAGE=VBScript %>
    : <%
    : Response.Write "<INPUT id=button11 name=button11 type=button
    value=Button11
    : LANGUAGE=vbscript onclick=""abcd()"">"
    : Response.Write "<BR>"
    : %>
    : <SCRIPT Language=VBScript>
    : function abcd()
    : Response.Redirect("http://192.168.1.31")
    : end function
    : </SCRIPT>
    :
    : But when click button11,can't redirect.
    : Can you help me
    :
    :
     
    Ken Schaefer, Dec 4, 2003
    #2
    1. Advertising

  3. Jack

    Jack Guest

    Thank you very much
     
    Jack, Dec 4, 2003
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?VHJveQ==?=

    Response.redirect does not redirect from .aspx page

    =?Utf-8?B?VHJveQ==?=, Oct 18, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    5,261
    Srowe1975
    Oct 15, 2008
  2. GS
    Replies:
    3
    Views:
    361
    Harlan Messinger
    Nov 14, 2006
  3. Sal
    Replies:
    1
    Views:
    570
  4. Ron Howard
    Replies:
    2
    Views:
    529
    Ron Howard
    Aug 11, 2004
  5. GS
    Replies:
    1
    Views:
    99
    Randy Webb
    Nov 14, 2006
Loading...

Share This Page