asp:buttion , history.back

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!
 
V

Vidar Petursson

Hi

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

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

szabelin

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
 
V

Vidar Petursson

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

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

szabelin

Thank you Vidar.

Sergey

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

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

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



.
 

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

Forum statistics

Threads
473,744
Messages
2,569,481
Members
44,900
Latest member
Nell636132

Latest Threads

Top