开发者

ASP.NET multiple Eval fields

开发者 https://www.devze.com 2022-12-21 08:59 出处:网络
I need to include multiple Eval fields in the Navigate URL field of a hyperlink control, however, the code I have tried does not work.

I need to include multiple Eval fields in the Navigate URL field of a hyperlink control, however, the code I have tried does not work.

<asp:HyperLink ID="hlkImageLink" runat="server" NavigateUrl='<%# Eval("getProductIDGV","getProduc开发者_高级运维tCategoryNameGV","getProductCategoryIDGV", "~/PT_productdetails.aspx?ProductID={0}&amp;CategoryName={1}&amp;CategoryID={2}") %>'>


Try:

NavigateUrl= '<%# String.Format("~/PT_productdetails.aspx?ProductID={0}&CategoryName={1}&CategoryID={2}", HttpUtility.UrlEncode(Eval("getProductIDGV")), HttpUtility.UrlEncode(Eval("getProductCategoryNameGV")), HttpUtility.UrlEncode(Eval("getProductCategoryIDGV"))) %>'
0

精彩评论

暂无评论...
验证码 换一张
取 消