定义全局变量:
 public string BizLocked = "true";<asp:TextBox ID="ITbudget" CssClass="Proposal_Input" Enabled='<%=BizLocked%>' runat="server"></asp:TextBox>提示出错:无法从其“Enabled”属性的字符串表示形式“<%=ItLocked%>”创建“System.Boolean”类型的对象。

解决方案 »

  1.   

    最简单的方法...
    if(BizLocked.Equals("true"))
    {
        ITbudget.Enabled=True;
    }
    else
    {
        ITbudget.Enabled=False;
    }
      

  2.   

    <%=BizLocked%> 这个不可以用服务器控件标签内, 你可以改用 <%# BizLocked %>,不过建议你把字段封装到属性里
      

  3.   

    <%# BizLocked %>, 这个表达式需要在 page load 里调用 databind 才会起作用
      

  4.   

    呵呵、
    建议<%# BizLocked %>
      

  5.   

    <%# BizLocked %>, 不起任何作用。
      

  6.   

    Enabled= <%=BizLocked%>
    这样试下
      

  7.   

    ITbudget.Enabled=bool.pare(BizLocked)?true:false;
      

  8.   


    <%# BizLocked %>, 这个表达式需要在 page load 里调用 databind 才会起作用