コード例 #1
0
        public static string GetStringParameter(StateBag viewState, string fieldName, string defaultValue)
        {
            string returnValue = WebFormsHelper.GetStringViewState(viewState, fieldName);

            if (string.IsNullOrEmpty(returnValue))
            {
                returnValue = defaultValue;
            }
            return(returnValue);
        }
コード例 #2
0
        public static string GetRequiredStringViewState(StateBag viewState, string fieldName)
        {
            string returnValue = WebFormsHelper.GetStringViewState(viewState, fieldName);

            if (string.IsNullOrEmpty(returnValue))
            {
                throw new Exception(string.Format("Missing required ViewState string value \"{0}\"", fieldName));
            }
            return(returnValue);
        }
コード例 #3
0
 protected string GetStringViewState(string fieldName)
 {
     return(WebFormsHelper.GetStringViewState(this.ViewState, fieldName));
 }