Exemplo n.º 1
0
        public static bool GetRequiredBoolViewState(StateBag viewState, string fieldName)
        {
            bool?returnValue = WebFormsHelper.GetBoolViewState(viewState, fieldName);

            if (!returnValue.HasValue)
            {
                throw new Exception(string.Format("Missing required ViewState boolean value \"{0}\"", fieldName));
            }
            return(returnValue.Value);
        }
Exemplo n.º 2
0
        public static bool GetBoolParameter(StateBag viewState, string fieldName, bool defaultValue)
        {
            bool?returnValue = WebFormsHelper.GetBoolViewState(viewState, fieldName);

            return(returnValue.GetValueOrDefault(defaultValue));
        }
Exemplo n.º 3
0
 protected bool?GetBoolViewState(string fieldName)
 {
     return(WebFormsHelper.GetBoolViewState(this.ViewState, fieldName));
 }