Control.ViewStateIgnoresCase 属性

定义

获取一个值,该值指示 StateBag 对象是否不区分大小写。Gets a value that indicates whether the StateBag object is case-insensitive.

protected:
 virtual property bool ViewStateIgnoresCase { bool get(); };
[System.ComponentModel.Browsable(false)]
protected virtual bool ViewStateIgnoresCase { get; }
member this.ViewStateIgnoresCase : bool
Protected Overridable ReadOnly Property ViewStateIgnoresCase As Boolean

属性值

如果 StateBag 实例不区分大小写,则为 true;否则为 falsetrue if the StateBag instance is case-insensitive; otherwise, false. 默认值为 falseThe default is false.

属性

示例

下面的示例演示如何重写 ViewStateIgnoresCase 属性以返回 trueThe following example demonstrates how to override the ViewStateIgnoresCase property to return true.

// Override the ViewStateIgnoresCase property to allow the same
// entries with different casing to be stored in the control's
// ViewState property.
protected override bool ViewStateIgnoresCase
{
        get
        { 
                return true; 
        }
}
' Override the ViewStateIgnoresCase property to allow the same
' entries with different casing to be stored in the control's
' ViewState property.
Overrides Protected ReadOnly Property ViewStateIgnoresCase As Boolean
   Get
      Return True
   End Get
End Property

注解

如果创建的自定义服务器控件在不考虑大小写的情况下保存其视图状态,请重写此方法。Override this method if you create a custom server control that saves its view state without taking case into account. 当你这样做时,多个具有相同键但大小写不同的对象可以存储在与 ViewState 属性关联的 StateBag 中。When you do so multiple objects with the same key, but with different casing, can be stored in the StateBag associated with the ViewState property.

适用于

另请参阅