protected void NewLocation_Click(object sender, EventArgs e) { LinkButton btn = sender as LinkButton; if (btn != null) { UrlRedirect redirect = new UrlRedirect(); redirect.Url = this.Controller.Path + ".%"; this.Controller.UrlRedirects.Add(redirect); this.Controller.ControllerID = new Guid(btn.CommandArgument); this.Controller.Save(); this.MoveToSection.Visible = false; this.MoveToResult.Visible = true; this.MoveToResult.InnerText = string.Format("\"{0}\" successfully moved to \"{1}\"", this.Controller.FileName, this.Controller.Path); } }
protected void RedirectSaveButton_Click(object sender, EventArgs e) { if (this.UrlRedirect_Url.Text != null && this.UrlRedirect_Url.Text.Length > 0) { UrlRedirect redirect = new UrlRedirect(this.UrlRedirect_Url.Text); redirect.Url = this.UrlRedirect_Url.Text; redirect.PathExtra = this.UrlRedirect_PathExtra.Text; if (redirect.PathExtra != null && redirect.PathExtra.Length > 0) { redirect.PathExtra = "/" + redirect.PathExtra; } redirect.Handler = this.UrlRedirect_Handler.SelectedValue; this.Controller.UrlRedirects.Add(redirect); this.Controller.Save(); foreach (UrlRedirect r in this.Controller.UrlRedirects) { r.Save(); } this.UrlRedirect_PathExtra.Text = ""; this.UrlRedirect_Url.Text = ""; Response.Redirect(Request.RawUrl); } }