Hot answers tagged

2

To go more precise I would like to code it in following manner. if (Request.QueryString.Count > 0) { string urlSource = Request.QueryString["Source"]; if (!String.IsNullOrEmpty(urlSource)) { int pos = urlSource.LastIndexOf(@"/"); String newUrl = urlSource.Substring(0, pos + 1) + "/AllItems.aspx"; ...


2

If I understood you correctly, then following is your requirement. Checking whether Source exists in query string or not If it exists, then redirect to that URL Example string source = Request.QueryString["Source"]; if (source != "") { SPUtility.Redirect(source, SPRedirectFlags.Default, HttpContext.Current); }



Only top voted, non community-wiki answers of a minimum length are eligible