UrlPropertyAttributeとは? わかりやすく解説

UrlPropertyAttribute クラス

メモ : このクラスは、.NET Framework version 2.0新しく追加されたものです。

コントロールURL 値を含む文字列プロパティ識別するために使用される属性定義します。このクラス継承できません。

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

<AttributeUsageAttribute(AttributeTargets.Property)> _
Public NotInheritable Class
 UrlPropertyAttribute
    Inherits Attribute
Dim instance As UrlPropertyAttribute
[AttributeUsageAttribute(AttributeTargets.Property)] 
public sealed class UrlPropertyAttribute :
 Attribute
[AttributeUsageAttribute(AttributeTargets::Property)] 
public ref class UrlPropertyAttribute sealed
 : public Attribute
/** @attribute AttributeUsageAttribute(AttributeTargets.Property) */ 
public final class UrlPropertyAttribute extends
 Attribute
AttributeUsageAttribute(AttributeTargets.Property) 
public final class UrlPropertyAttribute extends
 Attribute
解説解説
使用例使用例

URL 固有のプロパティ実装するクラスコード例次に示します。このコード例では、UrlPropertyAttribute 属性CustomHyperLinkControl クラスTargetUrl プロパティ適用します。この属性は、ASP.NET ファイル固有のファイル フィルタ設定します

Public Class CustomHyperLinkControl
    Inherits WebControl

    Public Sub New()
    End Sub 'New

    ' The TargetUrl property represents the URL that 
    ' the custom hyperlink control navigates to.        
    <UrlProperty("*.aspx")> _
    Public Property TargetUrl() As
 String
        Get
            Dim s As String
 = CStr(ViewState("TargetUrl"))
            If (s Is Nothing)
 Then
                Return String.Empty
            Else
                Return s
            End If
        End Get
        Set(ByVal value As
 String)
            ViewState("TargetUrl") = value
        End Set
    End Property

    ' The Text property represents the visible text that 
    ' the custom hyperlink control is displayed with.              
  
    Public Overridable Property
 [Text]() As String
        Get
            Dim s As String
 = CStr(ViewState("Text"))
            If (s Is Nothing)
 Then
                Return String.Empty
            Else
                Return s
            End If
        End Get
        Set(ByVal value As
 String)
            ViewState("Text") = value
        End Set
    End Property

    ' Implement method to render the control.

End Class 'CustomHyperLinkControl
public class CustomHyperLinkControl : WebControl
{
    public CustomHyperLinkControl() { }

    // The TargetUrl property represents the URL that 
    // the custom hyperlink control navigates to.
    [UrlProperty("*.aspx")]
    public string TargetUrl
    {
        get
        {
            string s = (string)ViewState["TargetUrl"];
            return ((s == null) ? String.Empty
 : s);
        }
        set
        {
            ViewState["TargetUrl"] = value;
        }
    }

    // The Text property represents the visible text that 
    // the custom hyperlink control is displayed with.        
    public virtual string Text
    {
        get
        {
            string s = (string)ViewState["Text"];
            return ((s == null) ? String.Empty
 : s);
        }
        set
        {
            ViewState["Text"] = value;
        }
    }

    // Implement method to render the control.
}
.NET Framework のセキュリティ.NET Frameworkセキュリティ
継承階層継承階層
System.Object
   System.Attribute
    System.Web.UI.UrlPropertyAttribute
スレッド セーフスレッド セーフ
この型の public static (Visual Basic では Shared) メンバはすべて、スレッド セーフです。インスタンス メンバ場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
UrlPropertyAttribute メンバ
System.Web.UI 名前空間

UrlPropertyAttribute コンストラクタ ()

メモ : このコンストラクタは、.NET Framework version 2.0新しく追加されたものです。

UrlPropertyAttribute クラス新し既定インスタンス初期化します。

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

Dim instance As New UrlPropertyAttribute
public UrlPropertyAttribute ()
public:
UrlPropertyAttribute ()
public UrlPropertyAttribute ()
public function UrlPropertyAttribute ()
解説解説

UrlPropertyAttribute クラス既定インスタンスは、"*.*" という値に設定されFilter プロパティ初期化されます

使用例使用例

URL 固有のプロパティ実装するクラスコード例次に示します。このコード例では、既定UrlPropertyAttribute 属性CustomHyperLinkControl クラスTargetUrl プロパティ適用します。この属性は、すべての URLサポートしていることを示し、"*.*" に設定され既定ファイル フィルタ指定してます。

Public Class CustomHyperLinkControl
    Inherits WebControl

    Public Sub New()
    End Sub 'New

    ' The TargetUrl property represents the URL that 
    ' the custom hyperlink control navigates to.        
    <UrlProperty()> _
    Public Property TargetUrl() As
 String
        Get
            Dim s As String
 = CStr(ViewState("TargetUrl"))
            If (s Is Nothing)
 Then
                Return String.Empty
            Else
                Return s
            End If
        End Get
        Set(ByVal value As
 String)
            ViewState("TargetUrl") = value
        End Set
    End Property

    ' The Text property represents the visible text that 
    ' the custom hyperlink control is displayed with.        

    Public Overridable Property
 [Text]() As String
        Get
            Dim s As String
 = CStr(ViewState("Text"))
            If (s Is Nothing)
 Then
                Return String.Empty
            Else
                Return s
            End If
        End Get
        Set(ByVal value As
 String)
            ViewState("Text") = value
        End Set
    End Property

    ' Implement method to render the control.

End Class 'CustomHyperLinkControl
public class CustomHyperLinkControl : WebControl
{
    public CustomHyperLinkControl() { }

    // The TargetUrl property represents the URL that 
    // the custom hyperlink control navigates to.
    [UrlProperty()]
    public string TargetUrl
    {
        get
        {
            string s = (string)ViewState["TargetUrl"];
            return ((s == null) ? String.Empty
 : s);
        }
        set
        {
            ViewState["TargetUrl"] = value;
        }
    }

    // The Text property represents the visible text that 
    // the custom hyperlink control is displayed with.        
    public virtual string Text
    {
        get
        {
            string s = (string)ViewState["Text"];
            return ((s == null) ? String.Empty
 : s);
        }
        set
        {
            ViewState["Text"] = value;
        }
    }

    // Implement this method to render the control.
}
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
UrlPropertyAttribute クラス
UrlPropertyAttribute メンバ
System.Web.UI 名前空間

UrlPropertyAttribute コンストラクタ (String)

メモ : このコンストラクタは、.NET Framework version 2.0新しく追加されたものです。

UrlPropertyAttribute クラス新しインスタンス初期化しFilter プロパティ指定した文字列設定します

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

Dim filter As String

Dim instance As New UrlPropertyAttribute(filter)
public UrlPropertyAttribute (
    string filter
)
public:
UrlPropertyAttribute (
    String^ filter
)
public UrlPropertyAttribute (
    String filter
)
public function UrlPropertyAttribute (
    filter : String
)

パラメータ

filter

URL 固有のプロパティ関連付けられたファイル フィルタ

解説解説
使用例使用例

URL 固有のプロパティ実装するクラスコード例次に示します。このコード例では、UrlPropertyAttribute 属性CustomHyperLinkControl クラスTargetUrl プロパティ適用します。この属性は、ASP.NET ファイル固有のファイル フィルタ設定します

Public Class CustomHyperLinkControl
    Inherits WebControl

    Public Sub New()
    End Sub 'New

    ' The TargetUrl property represents the URL that 
    ' the custom hyperlink control navigates to.        
    <UrlProperty("*.aspx")> _
    Public Property TargetUrl() As
 String
        Get
            Dim s As String
 = CStr(ViewState("TargetUrl"))
            If (s Is Nothing)
 Then
                Return String.Empty
            Else
                Return s
            End If
        End Get
        Set(ByVal value As
 String)
            ViewState("TargetUrl") = value
        End Set
    End Property

    ' The Text property represents the visible text that 
    ' the custom hyperlink control is displayed with.              
  
    Public Overridable Property
 [Text]() As String
        Get
            Dim s As String
 = CStr(ViewState("Text"))
            If (s Is Nothing)
 Then
                Return String.Empty
            Else
                Return s
            End If
        End Get
        Set(ByVal value As
 String)
            ViewState("Text") = value
        End Set
    End Property

    ' Implement method to render the control.

End Class 'CustomHyperLinkControl
public class CustomHyperLinkControl : WebControl
{
    public CustomHyperLinkControl() { }

    // The TargetUrl property represents the URL that 
    // the custom hyperlink control navigates to.
    [UrlProperty("*.aspx")]
    public string TargetUrl
    {
        get
        {
            string s = (string)ViewState["TargetUrl"];
            return ((s == null) ? String.Empty
 : s);
        }
        set
        {
            ViewState["TargetUrl"] = value;
        }
    }

    // The Text property represents the visible text that 
    // the custom hyperlink control is displayed with.        
    public virtual string Text
    {
        get
        {
            string s = (string)ViewState["Text"];
            return ((s == null) ? String.Empty
 : s);
        }
        set
        {
            ViewState["Text"] = value;
        }
    }

    // Implement method to render the control.
}
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
UrlPropertyAttribute クラス
UrlPropertyAttribute メンバ
System.Web.UI 名前空間

UrlPropertyAttribute コンストラクタ

UrlPropertyAttribute クラス新しインスタンス初期化します。
オーバーロードの一覧オーバーロードの一覧

名前 説明
UrlPropertyAttribute () UrlPropertyAttribute クラス新し既定インスタンス初期化します。
UrlPropertyAttribute (String) UrlPropertyAttribute クラス新しインスタンス初期化しFilter プロパティ指定した文字列設定します
参照参照

関連項目

UrlPropertyAttribute クラス
UrlPropertyAttribute メンバ
System.Web.UI 名前空間

UrlPropertyAttribute プロパティ


UrlPropertyAttribute メソッド


パブリック メソッドパブリック メソッド

( プロテクト メソッド参照)
  名前 説明
パブリック メソッド Equals オーバーロードされますオーバーライドされます指定されオブジェクトが、UrlPropertyAttribute オブジェクト現在のインスタンス等しかどうか示します
パブリック メソッド GetCustomAttribute  オーバーロードされますアセンブリモジュール、型のメンバ、またはメソッド パラメータ適用され指定した型のカスタム属性取得します。 ( Attribute から継承されます。)
パブリック メソッド GetCustomAttributes  オーバーロードされますアセンブリモジュール、型のメンバ、またはメソッド パラメータ適用されカスタム属性配列取得します。 ( Attribute から継承されます。)
パブリック メソッド GetHashCode オーバーライドされます。  
パブリック メソッド GetType  現在のインスタンスType取得します。 ( Object から継承されます。)
パブリック メソッド IsDefaultAttribute  派生クラス内でオーバーライドされたときに、このインスタンスの値が派生クラス既定値かどうか示します。 ( Attribute から継承されます。)
パブリック メソッド IsDefined  オーバーロードされます指定した型のカスタム属性が、アセンブリモジュール、型のメンバ、またはメソッド パラメータ適用されているかどうか判断します。 ( Attribute から継承されます。)
パブリック メソッド Match  派生クラス内でオーバーライドされたときに、指定したオブジェクトとこのインスタンス等しかどうかを示す値を返します。 ( Attribute から継承されます。)
パブリック メソッド ReferenceEquals  指定した複数Object インスタンス同一かどうか判断します。 ( Object から継承されます。)
パブリック メソッド ToString  現在の Object を表す String返します。 ( Object から継承されます。)
プロテクト メソッドプロテクト メソッド
参照参照

関連項目

UrlPropertyAttribute クラス
System.Web.UI 名前空間

UrlPropertyAttribute メンバ

コントロールURL 値を含む文字列プロパティ識別するために使用される属性定義します。このクラス継承できません。

UrlPropertyAttribute データ型公開されるメンバを以下の表に示します


パブリック コンストラクタパブリック コンストラクタ
  名前 説明
パブリック メソッド UrlPropertyAttribute オーバーロードされます。 UrlPropertyAttribute クラス新しインスタンス初期化します。
パブリック プロパティパブリック プロパティ
パブリック メソッドパブリック メソッド
( プロテクト メソッド参照)
  名前 説明
パブリック メソッド Equals オーバーロードされますオーバーライドされます指定されオブジェクトが、UrlPropertyAttribute オブジェクト現在のインスタンス等しかどうか示します
パブリック メソッド GetCustomAttribute  オーバーロードされますアセンブリモジュール、型のメンバ、またはメソッド パラメータ適用され指定した型のカスタム属性取得します。 (Attribute から継承されます。)
パブリック メソッド GetCustomAttributes  オーバーロードされますアセンブリモジュール、型のメンバ、またはメソッド パラメータ適用されカスタム属性配列取得します。 (Attribute から継承されます。)
パブリック メソッド GetHashCode オーバーライドされます。  
パブリック メソッド GetType  現在のインスタンスType取得します。 (Object から継承されます。)
パブリック メソッド IsDefaultAttribute  派生クラス内でオーバーライドされたときに、このインスタンスの値が派生クラス既定値かどうか示します。 (Attribute から継承されます。)
パブリック メソッド IsDefined  オーバーロードされます指定した型のカスタム属性が、アセンブリモジュール、型のメンバ、またはメソッド パラメータ適用されているかどうか判断します。 (Attribute から継承されます。)
パブリック メソッド Match  派生クラス内でオーバーライドされたときに、指定したオブジェクトとこのインスタンス等しかどうかを示す値を返します。 (Attribute から継承されます。)
パブリック メソッド ReferenceEquals  指定した複数Object インスタンス同一かどうか判断します。 (Object から継承されます。)
パブリック メソッド ToString  現在の Object を表す String返します。 (Object から継承されます。)
プロテクト メソッドプロテクト メソッド
参照参照

関連項目

UrlPropertyAttribute クラス
System.Web.UI 名前空間



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

辞書ショートカット

すべての辞書の索引

「UrlPropertyAttribute」の関連用語

UrlPropertyAttributeのお隣キーワード
検索ランキング

   

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



UrlPropertyAttributeのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

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

©2025 GRAS Group, Inc.RSS