FilterableAttribute(Boolean) コンストラクター

定義

FilterableAttribute クラスの新しいインスタンスを初期化します。

public:
 FilterableAttribute(bool filterable);
public FilterableAttribute(bool filterable);
new System.Web.UI.FilterableAttribute : bool -> System.Web.UI.FilterableAttribute
Public Sub New (filterable As Boolean)

パラメーター

filterable
Boolean

true 属性が適用されるプロパティがデバイスのフィルター処理をサポートしていることを示す場合。それ以外の場合は false

次のコード例では、カスタム コントロールのプロパティに FilterableAttribute 属性を適用する方法を示します。 このコンストラクターは、属性を表す FilterableAttribute オブジェクトを作成するために、ASP.NET によって内部的に呼び出されます。


using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Text;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Samples.AspNet.CS.Controls
{
    public class SimpleCustomControl : WebControl
    {
        private string _productID;

        // Set Filterable attribute to specify that this
        // property does not support device filtering.
        [Bindable(true)]
        [Filterable(false)]
        public string ProductID
        {
            get
            {
                return _productID;
            }
            set
            {
                _productID = value;
            }
        }
    }
}

Imports System.ComponentModel
Imports System.Web.UI

Namespace Samples.AspNet.VB.Controls

    Public Class SimpleCustomControl
        Inherits System.Web.UI.WebControls.WebControl

        Dim _productID As String

        ' Set Filterable attribute to specify that this
        ' property does not support device filtering.
        <Bindable(True), Filterable(False)> Property ProductID() As String
            Get
                Return _productID
            End Get

            Set(ByVal Value As String)
                _productID = Value
            End Set
        End Property
    End Class

End Namespace

注釈

このコンストラクターを使用して、 FilterableAttribute クラスの新しいインスタンスを作成します。 次の表に、 FilterableAttribute クラスのインスタンスの初期プロパティ値を示します。

財産 初期値
Filterable filterable パラメーターの値。

適用対象

こちらもご覧ください