textbox的text属性能否用变量代替
dim mingcheng1 as string = "沙发 "
<asp:textbox ID= "mingcheng " runat= "server " Text= "mingcheng1 " />
结果显示的是 "mingcheng1 ",而不是“沙发”
请问text属性如何绑定变量?
------解决方案-------------------- <asp:textbox ID= "mingcheng " runat= "server " Text= " <%# mingcheng1%> " />
后台中还在执行一下DataBind()方法,不然没用的.
Page.DataBind()或者 容器.DataBind()
在HTML中用 <%# %>
在Script代码块中才用 <%= %>