Click here to Skip to main content
15,888,803 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear Friends,

I have a IMAGE.

My requirement is, I need to add a Back Button or hyperlink on to that Image.

When User Clicks on to that Image Hyperlink, It must go back to previous page.

Please help me, How to add Hyperlink(Go Back) on a image...so that the users can navigate to another page.

Thanks
Posted

Hi ,
Check this
XML
<a href="Default.aspx"><img src="images/Good-mark.png" /></a>
       <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="~/Default3.aspx"><img src="Good-mark.png" /></asp:HyperLink>


Best Regards
M.Mitwalli
 
Share this answer
 
Comments
Ranjith Reddy CSE 3-Sep-12 5:38am    
Boss, I need to add Hyperlink on the IMAGE. Please help me.

When the user clicks that hyperlink..it must navigate to another page.

I should Redirect to another page when Hyperlink clicks But not the Image.

Please help.

I want to Clear is that. HOW TO ADD HYPERLINK ON IMAGE.
Mohamed Mitwalli 3-Sep-12 5:47am    
Well the example i provided to you simulate what you ask
Manas Bhardwaj 3-Sep-12 6:22am    
Good +5
Mohamed Mitwalli 3-Sep-12 6:27am    
Thank you Manas
Prasad_Kulkarni 3-Sep-12 7:09am    
5'ed
Hi,

What i understand from your question is, you want a button on the image. button should be display like it is placed on the image. correct?

If so, you can do that using Absolute position of your control.

XML
<div>
        <asp:Image ID="Image1" style="position:absolute"  runat="server" ImageUrl="~/Water lilies.jpg" />
        <asp:Button ID="Button1" runat="server" style="position:absolute" Text="Button" />
    </div>

Above code is just sample.you need to do some more adjustment and margin with the button control to adjust on desired location. Disadvantage of above resolution is, you can not control on screen resolution. your design will not be looked similar in all monitors with different resolution.

Hope something from above lead you to solution,
Thanks
-Amit Gajjar
 
Share this answer
 
Comments
Manas Bhardwaj 3-Sep-12 6:22am    
5+
AmitGajjar 3-Sep-12 6:23am    
Thanks
Ranjith Reddy CSE 3-Sep-12 6:33am    
Many Thanks
AmitGajjar 3-Sep-12 6:41am    
Your welcome.
Why dont you using LINKLABEL control.
Place the linkLabel below your Image.
and on CLick event of the LinkLabel,Redirect to Another Page.
 
Share this answer
 
Try This
Put a ImageButton Control,place it where you want it.
<asp:imagebutton id="ImageButton1" runat="server" backcolor="#FF6699" xmlns:asp="#unknown">
            Height="20px" ImageAlign="Middle" ImageUrl="~/Images/goback3.JPG" />
</asp:imagebutton>

and Just on click event of ImageButton
Response.Redirect("pageWhereYouWantToGo.aspx?parameter=" + parameterToSend.Text + "")
 
Share this answer
 
Comments
Ranjith Reddy CSE 3-Sep-12 5:38am    
Boss, I need to add Hyperlink on the IMAGE. Please help me.

When the user clicks that hyperlink..it must navigate to another page.

I should Redirect to another page when Hyperlink clicks But not the Image.

Please help.

I want to Clear is that. HOW TO ADD HYPERLINK ON IMAGE.
hi,

you can try the following code for that.

ASP.NET
<div>
<asp:image id="Image1" style="position:relative" runat="server" imageurl="1.jpg" xmlns:asp="#unknown" />
</div>
<div>
<asp:button id="Button1" runat="server" style="position:absolute" text="Button" xmlns:asp="#unknown" />
</div>


Also set the Margin in the button div. It will give you desired position.
like :

CSS
margin : -160px 0 0 85px;


I hope it will help you,

Thanks,
Viprat
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900