How can I redirect

J

Jack

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
 
K

Ken Schaefer

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


: 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
:
:
 

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,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top