如:
.aspx页面下有
<body>
<Label id="label">abc</Label>
</body>我想在页面的 Page_Load事件中设置<Label>标签的值为aaa
请问各位大虾怎么弄啊,可以用JS,
但是别说换成服务器控件之类的回复,谢谢

解决方案 »

  1.   

    ClientScript.RegisterStartupScript
                            (GetType(), "", "<script>function();</script>");<script type="javascript/text">
         function(){alert('497946');}
    </script>
      

  2.   

    ScriptManager.RegisterStartupScript(this, typeof(Page), "", "<script>document.getElementById('label').innerHTML='你好'</script>", false);
      

  3.   


       $(function () {
                $("#label").text("aaa");
            });
      

  4.   

    <Label id="label"><%=str%></Label>
    </body>Page_Load:public string str = "aaa";
      

  5.   

    str 在类里定义。Page_Load里赋值。上面有点错。
      

  6.   

    加个runnat=server  直接赋值  label.value="abc";
      

  7.   

    定义成服务器端控件加个runnat=server 直接赋值 label.value="abc";