private string GetReturnUrl() { string returnUrl = "/"; var referrer = this.Request.UrlReferrer; if (referrer != null) { string domain = referrer.DnsSafeHost; bool wellKnown = DbConvention.IsValidDomain(domain); if (wellKnown) { returnUrl = referrer.ToString(); } } return(returnUrl); }