public String GetPage(String pPageName, String pParamString) { reset(); PageName = pPageName; String pPageNameClean = pPageName; if (pPageNameClean.Contains("/")) { pPageNameClean = pPageName.Split('/')[1]; } NameValueCollection parts = HttpUtility.ParseQueryString(pParamString); Type objType = GetType(); MethodInfo handler = null; try { handler = objType.GetMethod("Page_" + pPageNameClean); if (handler == null) { return("<h1>Page not found: " + pPageName + "</h1>"); } } catch (Exception e) { Console.WriteLine("Exception : " + e.ToString()); } PageReturn page = handler.Invoke(this, new object[] { pPageName, pPageNameClean, parts }) as PageReturn; if (page.full_page) { return(page.content); } else { AddHeader(hsHost.GetPageHeader(pPageName, pPageNameClean, "", "", false, true)); AddBody(page.content); this.RefreshIntervalMilliSeconds = 10; suppressDefaultFooter = true; AddFooter(hsHost.GetPageFooter()); return(BuildPage()); } }
public String PostBack(String pPageName, String pParamString, String pUser, int pUserRights) { reset(); PageName = pPageName; String pPageNameClean = pPageName; if (pPageNameClean.Contains("/")) { pPageNameClean = pPageName.Split('/')[1]; } NameValueCollection parts = HttpUtility.ParseQueryString(pParamString); Type objType = GetType(); MethodInfo handler = null; try { handler = objType.GetMethod("PostHandler_" + pPageNameClean); if (handler == null) { return("<h1>Page not found: " + pPageName + "</h1>"); } } catch (Exception e) { Console.WriteLine("Exception : " + e.ToString()); } PageReturn page = handler.Invoke(this, new object[] { pPageName, pPageNameClean, parts }) as PageReturn; if (page.full_page) { return(page.content); } else { return(postBackProc(pPageName, pParamString, pUser, pUserRights)); } }