如何在Image上添加/创建asp.net超链接或按钮 [英] How to Add / create a asp.net hyperlink or button on Image

查看:433
本文介绍了如何在Image上添加/创建asp.net超链接或按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的朋友们,



我有一张图片。



我的要求是,我需要在该图像上添加一个后退按钮或超链接。



当用户点击该图像超链接时,必须返回上一页。



请帮帮我,如何在图片上添加超链接(Go Back)...以便用户可以导航到另一个页面。



谢谢

解决方案

您好,

查看此

 <   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 > ;





最好的问候

M.Mitwalli


< blockquote>



我从你的问题中理解的是,你想在图像上有一个按钮。按钮应显示为放置在图像上。正确吗?



如果是这样,你可以使用你控制的绝对位置来做到这一点。



 <   div  >  
< asp:Image ID = Image1 style = position:absolute runat = server ImageUrl = 〜/ Water lilies.jpg / >
< asp:按钮 ID = Button1 runat = server 样式 = position:absolute 文字 = 按钮 / >
< / div >



以上代码只是示例。您需要使用按钮控件进行更多调整和保证,以调整所需位置。上述分辨率的缺点是,你无法控制屏幕分辨率。在所有具有不同分辨率的显示器上,您的设计看起来都不相似。



希望上面的东西引导您找到解决方案,

谢谢

-Amit Gajjar


为什么不使用LINKLABEL控件。

将linkLabel放在你的Image下面。

以及LinkLabel的CLick事件,重定向到另一个页面。


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

解决方案

Hi ,
Check this

<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


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.

<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


Why dont you using LINKLABEL control.
Place the linkLabel below your Image.
and on CLick event of the LinkLabel,Redirect to Another Page.


这篇关于如何在Image上添加/创建asp.net超链接或按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆