asp:hyperLink NavigateURL and Eval functions

后端 未结 2 1118
予麋鹿
予麋鹿 2021-01-27 01:17

What is the correct syntax to add a Eval() function to the NavigateURL attribute of asp:HyperLink?

I am trying to achieve the below:

NavigateUrl=\"http:/         


        
相关标签:
2条回答
  • 2021-01-27 01:52

    It wasn't works my site. I found the following solution:

    NavigateUrl='<%# string.Format("~/Home.aspx?{0}", HttpUtility.UrlEncode(Eval("U_ID").ToString())) %>'
    
    0 讨论(0)
  • 2021-01-27 02:11

    Try with this

     NavigateUrl='http://home/?<%# Eval("U_ID") %>'
    

    or

     NavigateUrl='<%# "http://home/?" + (string)Eval("U_ID") %>'
    
    0 讨论(0)
提交回复
热议问题