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>

<form runat="server" >
<asp:Button ID="button1" OnClick="Button1_Click"
Text="Get ClientID" runat="server" />
</form>

实例

展示 Button 控件的 ClientID