获取与控件的属性不对应的任意特性(只用于呈现)的集合。
例:
btnDelete.Attributes.Add("onclick", "return confirm('Warning: This will delete ALL records, including all content pages and users, associated with this community.')")
获取与控件的属性不对应的任意特性(只用于呈现)的集合。
<%@ Page Language="VB" AutoEventWireup="True" %>
<html>
<head>
<script language="VB" runat="server">
Sub Page_Load(sender As Object, e As EventArgs)
TextBox1.Attributes("onblur") = "javascript:alert('Hello! Focus lost from text box!!');"
End Sub
</script>
</head>
<body>
<h3>Attributes Property of a Web Control</h3>
<form runat="server">
<asp:TextBox id="TextBox1" columns=54
Text="Click here and then tap out of this text box"
runat="server"/>
</form>
</body>
</html>