public static void JumpToUrl(string rawurl, string query) { UrlScheme urlScheme = UrlScheme.Parse(rawurl); urlScheme.AttachQuery(query); HttpContext.Current.Response.Redirect(urlScheme.ToString()); }
public static UrlScheme GetCurrentUrlScheme() { UrlScheme scheme; if (HttpContext.Current.Items[cachekey_CurrentUrlScheme] == null) { scheme = UrlScheme.Parse(RawUrl); ////检查是否板块的首页 //string codename = null; //if (StringUtil.EndsWithIgnoreCase(scheme.Main, "/default")) // codename = scheme.Main.Remove(scheme.Main.Length - 8); //else if (StringUtil.EndsWithIgnoreCase(scheme.Main, "/index")) // codename = scheme.Main.Remove(scheme.Main.Length - 6); //else // codename = scheme.Main; //if (string.IsNullOrEmpty(codename) != null && ForumBOV5.Instance.GetForum(codename) != null) // scheme.Main = codename + "/list-1"; HttpContext.Current.Items.Add(cachekey_CurrentUrlScheme, scheme); } else { scheme = (HttpContext.Current.Items[cachekey_CurrentUrlScheme] as UrlScheme).Clone(); } return(scheme); }