asp:buttion , history.back

  • Thread starter Thread starter szabelin
  • Start date Start date
S

szabelin

Hello,

how do I do history back when asp:button is clicked? I
can't use <input button> - I have to use asp:button.


Thanks!
 
Hi

myButton.Attributes.Add("onclick","history.back()");

--
Best Regards
Vidar Petursson
==============================
Microsoft Internet Client & Controls MVP
==============================
 
I tried this already - it doesn't work for me. A button
click causes postback to server. Is there a way to cancel
postback? Here is my script code:

<asp:Button CssClass="AllButtons" CausesValidation="False"
Width="100px" Height="28px" Runat="server" Text="Back"
ID="NavBack" Enabled="True"></asp:Button>


and I added:
NavBack.Attributes.Add("onclick","history.back()");
in the Page_Load.....


thanks
Sergey
 
NavBack.Attributes.Add("onclick","history.back(); return false");

--
Best Regards
Vidar Petursson
==============================
Microsoft Internet Client & Controls MVP
==============================
 
Thank you Vidar.

Sergey

-----Original Message-----

NavBack.Attributes.Add("onclick","history.back(); return false");

--
Best Regards
Vidar Petursson
==============================
Microsoft Internet Client & Controls MVP
==============================



.
 
Back
Top