public static void SetAttributePageInfo(IStateManager stateManager, string key, string attributeName, AttributePageControlInfo attributePageControlInfo) { Dictionary <string, AttributePageControlInfo> list = ((StateBag)stateManager)[key] as Dictionary <string, AttributePageControlInfo>; if (list == null) { list = new Dictionary <string, AttributePageControlInfo>(); } if (list.ContainsKey(attributeName)) { list[attributeName] = attributePageControlInfo; } else { list.Add(attributeName, attributePageControlInfo); } ((StateBag)stateManager)[key] = list; }
private static AttributeValue GetAttributeValue(AttributePageControlInfo attributePageControlInfo, HttpContext httpContext) { switch (attributePageControlInfo.RequestFindMethod) { case RequestFindMethod.ExactMatch: return(new AttributeValue(httpContext.Request.Form[attributePageControlInfo.UniqueId])); //break; case RequestFindMethod.BeginsWith: foreach (string key in httpContext.Request.Form.AllKeys) { if (key.StartsWith(attributePageControlInfo.UniqueId)) { return(new AttributeValue( HttpUtility.HtmlDecode(httpContext.Request.Form[key]) // Requesting directly gives us value in html encoded form, so we want to decode to preserve html styling. )); } } break; } return(null); }