public string getUrl() { string tempUrl = HttpContext.Current.Request["url"]; if (tempUrl == null || tempUrl.Trim() == "") { this.currentUrl = HttpContext.Current.Request.UrlReferrer; } else { if(tempUrl == HttpContext.Current.Request.UrlReferrer) this.currentUrl = "Default.aspx"; else this.currentUrl = tempUrl; } if (this.currentUrl == null || this.currentUrl.Trim() == "") this.currentUrl = "Default.aspx"; return this.currentUrl; }