Button.Attributes.Add 的问题

antimicrosoft antimicrosoft 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
<html>
<body>
<form runat="server">
<asp:Label id="lbl" text="111" Runat="server" /><br>
<asp:Button text="too" id="btn1" RunAt="server" />
</form>
</body>
</html>

<script language="C#" runat="server">
void Page_Load(object sender, EventArgs e)
{
btn1.Attributes.Add("onclick","this.lbl.Visible=false");
}

</script>
执行这段代码之后并没有将lbl的状态改变,请问是为什么?
...全文

相关推荐

评论 9
收藏 已收藏
分享
返回顶部
antimicrosoft
.NET社区 62,271 成员 668,968 内容