Many Eval ASP.NET Fields

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

<asp:HyperLink ID="hlkImageLink" runat="server" NavigateUrl='<%# Eval("getProductIDGV","getProductCategoryNameGV","getProductCategoryIDGV", "~/PT_productdetails.aspx?ProductID={0}&amp;CategoryName={1}&amp;CategoryID={2}") %>'> 
+4
source share
1 answer

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"))) %>' 
+8
source

Source: https://habr.com/ru/post/1302329/


All Articles