How to use ASP.NET <%= tags in server control attributes?

后端 未结 7 1546
陌清茗
陌清茗 2020-11-28 10:15

This works:

\" />

This doesn\'t work:

         


        
7条回答
  •  栀梦
    栀梦 (楼主)
    2020-11-28 10:48

    In my code i am using something like this easily but in the databound control like ListView Item template

     
    

    But when i tried to use outside the databound control using <%# .. %>, it simply doesn't work.

    You can easily do with

    My href 
    

    But for server controls, and outside of databound control. We need to call DataBind() in pageload event explicitly

    
    

提交回复
热议问题