.cs中声明的变量,在aspx文件中为什么不能使用呢?
1,在   hy1.aspx.cs中: 
          public   string   sname;   
          protected   void   Page_Load(object   sender,   EventArgs   e) 
             { 
                      sname   =    "张三 "; 
             }   
 2,   在   hy1.aspx中    
              <asp:Label   ID= "Label1 "   runat= "server "   Height= "45px "   Text= " <%=sname%>  "   Width= "91px ">  </asp:Label>    
 不知道,为什么在cs文件中,声明的sname变量,在aspx中,为什么不能显示被赋予的数值呢?   
 非常谢谢大家啊。
------解决方案--------------------public string sname =  "XXX "; 
 这样才可以
------解决方案-------------------- <asp:Label ID= "Label1 " runat= "server " Height= "45px " Width= "91px ">  <%=sname%>  </asp:Label>    
 试试
------解决方案--------------------protected void Page_Load(object sender, EventArgs e) 
     { 
        Label1.Text=  "张三 "; 
     }
------解决方案--------------------Label 改为客户端 Span
------解决方案--------------------服务器端控件不让那么绑数据的。 
 客户端的才可以