如何将多个数据字段添加到超链接控件 [英] How to add multiple data fields to the hyperlink control

查看:107
本文介绍了如何将多个数据字段添加到超链接控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道,如果可以向超链接控件添加多个数据字段,以便创建查询字符串(URL)。



我尝试低于唱EVAL但这个属性只考虑了2个参数。有没有其他方法可以做到这一点,如果是这样,请进一步建议。

I would like to know, if it is possible to add multiple data fields to the hyperlink control, in order to create querystring (URL).

I attempted below sing EVAL but this property only takes into account 2 arguments. Is there another way to do this, if so, please advice further.

<asp:TemplateField HeaderText="Details">
              <ItemTemplate>
     <asp:HyperLink ID="HyperLink1" runat="server"
         NavigateUrl='<%# Eval("uID","uEmailAddress", @"http://localhost/Test.aspx?code={0}&email={4}&mag=163") %>'
         Text='View More...'>
     </asp:HyperLink>
 </ItemTemplate>
         </asp:TemplateField>





非常感谢



Many thanks

推荐答案

您可以随时在代码隐藏中执行此操作,也可以参考此链接并使用string.format。



http://www.aspsnippets.com/Articles/Bind-Single-or-Multiple-QueryString-Parameters-to-NavigateUrl-of -HyperLink-using-Eval-function-inside-ASPNet-GridView.aspx [ ^ ]
You can always do it in your codebehind or you can refer to this link and use string.format.

http://www.aspsnippets.com/Articles/Bind-Single-or-Multiple-QueryString-Parameters-to-NavigateUrl-of-HyperLink-using-Eval-function-inside-ASPNet-GridView.aspx[^]


这篇关于如何将多个数据字段添加到超链接控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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