Advertisement

09.11.2007 at 02:39PM PDT, ID: 22821874
[x]
Attachment Details

How to createa a button that can go backto the previous  page using asp.net 2.0?

Asked by eddyinperu in .NET Framework 2.0, JavaScript, C# Programming Language

Tags: go, page, previous, button

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(img_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("onmouseover", "roll_over('imgbtnNext', '../images/Next.png')");
            imgbtnNext.Attributes.Add("onmouseout", "roll_over('imgbtnNext',   '../images/Next1.png')");

            imgbtnback.Attributes.Add("onmouseover", "roll_over('imgbtnback', '../images/back.png')");
            imgbtnback.Attributes.Add("onmouseout", "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
[+][-]09.11.2007 at 02:57PM PDT, ID: 19872569

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09.11.2007 at 05:06PM PDT, ID: 19873045

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09.12.2007 at 08:29AM PDT, ID: 19877144

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09.12.2007 at 10:36AM PDT, ID: 19878379

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09.13.2007 at 08:26AM PDT, ID: 19884548

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09.13.2007 at 10:14AM PDT, ID: 19885434

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09.14.2007 at 12:00PM PDT, ID: 19894238

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09.14.2007 at 12:43PM PDT, ID: 19894592

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09.14.2007 at 01:28PM PDT, ID: 19894936

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09.14.2007 at 03:39PM PDT, ID: 19895583

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: .NET Framework 2.0, JavaScript, C# Programming Language
Tags: go, page, previous, button
Sign Up Now!
Solution Provided By: Justin_W
Participating Experts: 2
Solution Grade: A
 
 
[+][-]09.18.2007 at 05:44AM PDT, ID: 19912189

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09.18.2007 at 10:27AM PDT, ID: 19914879

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628