Help! Respons.Redirect Kicks in Before Button is Clicked (1 Viewer)

KevinM

Registered User.
Local time
Today, 19:11
Joined
Jun 15, 2000
Messages
719
Using asp.net 1.1 I habv the following button on my page..

Code:
<input type="button" name="btnBack" value="BACK" onClick="<% Response.Redirect("MyPage.aspx")%>"/>

This is within a server side form although the button is not a server control

Problem is the redirect kicks in straight away and 'MyPage.aspx' is opened straight away.

Why is the button's onClick event activating without actually clicking on it?

Cheers

It was so much simpler in classic asp :rolleyes:
 

Kodo

"The Shoe"
Local time
Today, 15:11
Joined
Jan 20, 2004
Messages
707
you can't do that.
Either put a javascript function for the onClick event or use a .net control button and apply the redirect to it's event handler.
 

KevinM

Registered User.
Local time
Today, 19:11
Joined
Jun 15, 2000
Messages
719
Yeah, you're right, sorted now, I was just being lazy

Many Thanks
 

Users who are viewing this thread

Top Bottom