asp.net inline code <%# MyboolVal %>

自古美人都是妖i 提交于 2019-12-06 05:34:46

Try using = instead of # in your version:

<p>some text <%= String.Format("meeee {0}", Mybool) %></p>

The # is for databinding, so in the original code there must be a call to DataBind somewhere.

Canavar

<%# is databinding tag which is used to set values to server side controls, especially databound controls.

<%= is shorthand of Response.Write(), it writes the value to the output. So we use it with static html elements.

I think that problem is because visible property expect value of type string and you are trying to set it with bool.try to cast your value to string

Cheers

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!