当前位置: 首页>>代码示例>>C#>>正文


C# StateBag.TrackViewState方法代码示例

本文整理汇总了C#中System.Web.UI.StateBag.TrackViewState方法的典型用法代码示例。如果您正苦于以下问题:C# StateBag.TrackViewState方法的具体用法?C# StateBag.TrackViewState怎么用?C# StateBag.TrackViewState使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Web.UI.StateBag的用法示例。


在下文中一共展示了StateBag.TrackViewState方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: IStateManager_Deny_Unrestricted

		public void IStateManager_Deny_Unrestricted ()
		{
			IStateManager sm = new StateBag ();
			Assert.IsFalse (sm.IsTrackingViewState, "IsTrackingViewState");
			object state = sm.SaveViewState ();
			sm.LoadViewState (state);
			sm.TrackViewState ();
		}
开发者ID:nobled,项目名称:mono,代码行数:8,代码来源:StateBagCas.cs

示例2: EnsureAttributes

		private void EnsureAttributes ()
		{
			if (attributes == null) {
				attrBag = new StateBag (true);
				if (IsTrackingViewState)
					attrBag.TrackViewState ();
				attributes = new AttributeCollection (attrBag);
			}
		}
开发者ID:jjenki11,项目名称:blaze-chem-rendering,代码行数:9,代码来源:UserControl.cs

示例3: LoadViewState

 /// <devdoc>
 ///     Loads the view state for the control.
 /// </devdoc>
 protected override void LoadViewState(object savedState) {
     if (savedState != null) {
         Triplet stateTriplet = (Triplet)savedState;
         base.LoadViewState(stateTriplet.First);
         if (stateTriplet.Second != null) {
             if (_inputAttributesState == null) {
                 _inputAttributesState = new StateBag();
                 _inputAttributesState.TrackViewState();
             }
             _inputAttributesState.LoadViewState(stateTriplet.Second);
         }
         if (stateTriplet.Third != null) {
             if (_labelAttributesState == null) {
                 _labelAttributesState = new StateBag();
                 _labelAttributesState.TrackViewState();
             }
             _labelAttributesState.LoadViewState(stateTriplet.Second);
         }
     }
 }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:23,代码来源:CheckBox.cs

示例4: LoadViewState

        /// <internalonly/>
        /// <devdoc>
        ///    <para>Loads previously saved state.
        ///       Overridden to handle ViewState, Style, and Attributes.</para>
        /// </devdoc>
        protected override void LoadViewState(object savedState) {
            if (savedState != null) {
                Pair myState = (Pair)savedState;
                base.LoadViewState(myState.First);

                if (ControlStyleCreated || (ViewState[System.Web.UI.WebControls.Style.SetBitsKey] != null)) {
                    // the style shares the StateBag of its owner WebControl
                    // call LoadViewState to let style participate in state management
                    ControlStyle.LoadViewState(null);
                }
                else {
                    _webControlFlags.Set(deferStyleLoadViewState);
                }

                if (myState.Second != null) {
                    if (attrState == null) {
                        attrState = new StateBag(true);
                        attrState.TrackViewState();
                    }
                    attrState.LoadViewState(myState.Second);
                }
            }

            // Load values cached out of view state
            object enabled = ViewState["Enabled"];
            if (enabled != null) {
                if(!(bool)enabled) {
                    flags.Set(isWebControlDisabled);
                }
                else {
                    flags.Clear(isWebControlDisabled);
                }
                _webControlFlags.Set(disabledDirty);
            }

            if (((IDictionary)ViewState).Contains("AccessKey")) {
                _webControlFlags.Set(accessKeySet);
            }

            if (((IDictionary)ViewState).Contains("TabIndex")) {
                _webControlFlags.Set(tabIndexSet);
            }

            if (((IDictionary)ViewState).Contains("ToolTip")) {
                _webControlFlags.Set(toolTipSet);
            }

        }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:53,代码来源:WebControl.cs

示例5: LoadViewState

		protected override void LoadViewState (object savedState)
		{
			if (savedState == null)
				return;

			Triplet saved = (Triplet) savedState;
			base.LoadViewState (saved.First);
			
			if (saved.Second != null) {
				if (inputAttributesState == null) {
					inputAttributesState = new StateBag(true);
					inputAttributesState.TrackViewState ();
				}
				inputAttributesState.LoadViewState (saved.Second);
			}
			
			if (saved.Third != null) {
				if (labelAttributesState == null) {
					labelAttributesState = new StateBag(true);
					labelAttributesState.TrackViewState ();
				}
				labelAttributesState.LoadViewState (saved.Third);
			}
		}
开发者ID:jjenki11,项目名称:blaze-chem-rendering,代码行数:24,代码来源:CheckBox.cs

示例6: LoadViewState

		protected override void LoadViewState (object savedState)
		{
			if (savedState == null)
				return;

			Pair saved = (Pair) savedState;
			base.LoadViewState (saved.First);
			
			if (ControlStyleCreated || ViewState [System.Web.UI.WebControls.Style.selectionBitString] != null)
				ControlStyle.LoadViewState (null);

			if (saved.Second != null)
			{
				if (attributeState == null)
				{
					attributeState = new StateBag(true);
					attributeState.TrackViewState();
				}
				attributeState.LoadViewState (saved.Second);
			}
			
			object enable = ViewState["Enabled"];
			if (enable!=null)
			{
				Enabled = (bool)enable;
				EnableViewState = true; 
			}
		}
开发者ID:jjenki11,项目名称:blaze-chem-rendering,代码行数:28,代码来源:WebControl.cs


注:本文中的System.Web.UI.StateBag.TrackViewState方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。