Control.ViewStateIgnoresCase Control.ViewStateIgnoresCase Control.ViewStateIgnoresCase Control.ViewStateIgnoresCase Property

定义

获取一个值,该值指示 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返回true的属性。The 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. 当你这样做时,如果多个对象具有相同的键,但大小写不同,则StateBag可以存储在ViewState与属性关联的中。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.

适用于

另请参阅