WebControl.Attributes プロパティとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > WebControl.Attributes プロパティの意味・解説 

WebControl.Attributes プロパティ

コントロールプロパティ対応しない任意の属性 (表示専用) のコレクション取得します

名前空間: System.Web.UI.WebControls
アセンブリ: System.Web (system.web.dll 内)
構文構文

Dim instance As WebControl
Dim value As AttributeCollection

value = instance.Attributes
public AttributeCollection Attributes { get;
 }
public:
property AttributeCollection^ Attributes {
    AttributeCollection^ get ();
}
/** @property */
public AttributeCollection get_Attributes ()
public function get Attributes
 () : AttributeCollection

プロパティ
名前と値の組み合わせの AttributeCollection。

解説解説
使用例使用例

WebControlAttributes プロパティ使用してTextBox コントロールフォーカス失ったときに、JavaScript コマンド実行する方法の例を次に示します

メモメモ

次のコード サンプルはシングルファイル コード モデル使用しており、分離コード ファイル直接コピーされ場合正常に動作しない可能性あります。このコード サンプルは、拡張子.aspx の空のテキスト ファイルコピーする必要がありますWeb フォームコード モデル詳細については、「ASP.NET Web ページコード モデル」を参照してください

<%@ 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>
 
<%@ Page Language="C#" AutoEventWireup="True" %>

 <html>
 <head>
    <script language="C#" runat="server">
 
        void Page_Load(Object sender, EventArgs e) {
           TextBox1.Attributes["onblur"]="javascript:alert('Hello!
 Focus lost from text box!!');";    
        }
    </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>
 
<%@ Page Language="JScript" AutoEventWireup="True" %>

 <html>
 <head>
    <script language="JSCRIPT" runat="server">
 
        function Page_Load(sender : Object, e : EventArgs){
            TextBox1.Attributes("onblur") = "javascript:alert('Focus
 lost from text box!!');"
        }
    </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 tab out of this text box"
 
     runat="server"/>  
 
 </form>
 </body>
 </html>
 
<html>
<head>
   <script language="C#" runat="server">




   </script>

</head>
<body>
   <h3><font
 face="Verdana">Attributes Property of a Web Control</font></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>

プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
WebControl クラス
WebControl メンバ
System.Web.UI.WebControls 名前空間
System.Web.UI.AttributeCollection
System.Web.UI.ClientScriptManager
その他の技術情報
Web サーバー コントロール構文
ASP.NET カスタム サーバー コントロール開発



英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「WebControl.Attributes プロパティ」の関連用語

WebControl.Attributes プロパティのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



WebControl.Attributes プロパティのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2024 Microsoft.All rights reserved.

©2024 GRAS Group, Inc.RSS