HI Experts:
I have found many examples about how to use javascript with the go back function( the previous page:)
<A href="javascript:GoBack()"
>
<img src="../images/Back.gif" border="0">
</A>
function GoBack()
{
window.history.go(-1);
}
That is really nice but that is not what I want. I want to create an image button in asp.net 2.0 that can take me to the prevoius page and I don't want to use "response.redirect" because I won't be able to know which page will be the previous one. I am programming with c# and ASP.net 2.0, this is my code.
This is what I have so far:
MYPAGE.aspx:
<script>
function roll_over(img_name, img_src)
{
var test = document.getElementById(im
g_name);
test.src = img_src;
}
</script
<asp:ImageButton ID="imgbtnNext" ImageUrl="../images/Next1.
png" runat="server" />
<asp:ImageButton ID="imgbtnback" ImageUrl="../images/back1.
png" runat="server" />
MYPAGE.aspx.cs
imgbtnNext.Attributes.Add(
"onmouseov
er", "roll_over('imgbtnNext', '../images/Next.png')");
imgbtnNext.Attributes.Add(
"onmouseou
t", "roll_over('imgbtnNext', '../images/Next1.png')");
imgbtnback.Attributes.Add(
"onmouseov
er", "roll_over('imgbtnback', '../images/back.png')");
imgbtnback.Attributes.Add(
"onmouseou
t", "roll_over('imgbtnback', '../images/back1.png')");
onmouseover and onmouseout are working great but How can I get to the previous page?
Thanks for all your help!!!
Start Free Trial