给锚标记中的路径 [英] giving path in anchor tag

查看:53
本文介绍了给锚标记中的路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我有这样的锚标签

Hi,

I have an anchor tag like this

<a href="path"></a>



我的sql server中也有图像路径字符串upload / imagename.jpg。任何人都可以告诉我如何将数据库中的图像路径字符串放到锚标记上代替' path'.please help me.god祝福你



代码块添加 - OriginalGriff [/ edit]


Also i have image path string upload/imagename.jpg in my sql server.Can anyone tell me how to place image path string from database onto anchor tag in place of 'path'.please help me.god bless you

[edit]Code block added - OriginalGriff[/edit]

推荐答案

我就是这样做的: ASP.NET的通用Image-From-DB类 [ ^ ]





认为你没有得到我的问题。我的意思是我必须将数据库中的图像路径字符串放到锚标签的href部分。如果我有字符串大上传/ energy3.jpg'在我的sql server中编译锚标签应该在其href部分上有图像字符串



啊!好吧,你应该说......:笑:

将ID和RUNAT属性添加到你的href:< br $> b $ b

This is how I do it: A generic Image-From-DB class for ASP.NET[^]


"think you did'nt get my question. i meant i have to place image path string from database onto href part of anchor tag.Suppose if i have string big upload/energy3.jpg' in my sql server on compiling anchor tag should have image string on its href part"

Ah! Well, you should have said...:laugh:
Add the ID and RUNAT attributes to your href:

<a id="MyLink" runat="server" href="">Linky!</a>



然后设置来自C#的链接:


Then set the link from the C#:

MyLink.HRef = "http:www.MyDomain.com/Images/myImage.jpg";


上面提出的OriginalGriff解决方案'可以配置锚标签另外..但如果您尝试在数据控制中配置标签,如网格,则只需将href属性绑定到dtat base的预期字段。



这样的事情..

Solution suggested above by OriginalGriff' is OK for configuring anchor tag separately.. but if you are trying to configure tag in data control like grid then just bind href attribute to expected field from dtat base.

some thing like this..
<a id="MyLink"  runat="server" href="<%# DataBinder.Eval(Container.DataItem, "ImageUrl") %>">Linky!</a>


这篇关于给锚标记中的路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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