UrlPropertyAttribute コンストラクタ ()とは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > UrlPropertyAttribute コンストラクタ ()の意味・解説 

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 名前空間



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

辞書ショートカット

すべての辞書の索引

「UrlPropertyAttribute コンストラクタ ()」の関連用語

UrlPropertyAttribute コンストラクタ ()のお隣キーワード
検索ランキング

   

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



UrlPropertyAttribute コンストラクタ ()のページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

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

©2025 GRAS Group, Inc.RSS