我有一个案例,我需要在aspx页面中为asp标签设置Text属性,而不是从后面的代码.更确切地说,我需要在aspx页面中为asp控件设置一个值,并且该值由后面相同页面代码中的属性设置.
所以我需要使用表达式来做到这一点:
<asp:Label Text="<%= MyProperty %>" ..../>
Run Code Online (Sandbox Code Playgroud)
我用:
<%= MyProperty %> doesn't work.
<%# MyProperty %> doesn't also.
Run Code Online (Sandbox Code Playgroud) asp.net ×1