CSDN博客

img xuandhu

一个显示提示信息的对象WebControl.Attributes

发表于2004/10/17 10:30:00  799人阅读

获取与控件的属性不对应的任意特性(只用于呈现)的集合。
例:
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>

阅读全文
0 0

相关文章推荐

img
取 消
img