ASP.NET ClientID 属性
最后更新于:2022-03-26 23:27:18
ASP.NET ClientID 属性
定义和用法
ClientID 属性获取由 ASP.NET 自动生成的控件标识符。
实例
下面的实例显示 Button 控件的 ClientID:
<script runat=”server”>
Sub Button1_Click(sender As Object, e As EventArgs)
Response.Write(“The ClientID of the button is: “)
Response.Write(button1.ClientID)
End Sub
</script>
Sub Button1_Click(sender As Object, e As EventArgs)
Response.Write(“The ClientID of the button is: “)
Response.Write(button1.ClientID)
End Sub
</script>
<form runat=”server” >
<asp:Button ID=”button1″ OnClick=”Button1_Click”
Text=”Get ClientID” runat=”server” />
</form>