protected void Page_Load(object sender, EventArgs e) { btnNew.Attributes.Add("onclick", String.Format("document.location.href='EditRedirection.aspx{0}&FileId=-1'", GetBaseQueryString())); rptFiles.DataSource = RedirectionModule.GetAllUrls(); rptFiles.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { if (RedirectionModule.ShouldRedirect) { string url = RedirectionModule.RedirectToCurrentFile(); Response.Redirect(url); } rptFiles.DataSource = RedirectionModule.GetAllUrls(); rptFiles.DataBind(); }
public void btnSave_Click(object sender, System.EventArgs e) { if (!IsValid) { return; } Url.Publisher = User.Identity as User; Url.Title = txtTitle.Text; Url.DatePublished = calDatePublished.SelectedDate; Url.Url = txtUrl.Text; try { RedirectionModule.Save(Url); Context.Response.Redirect("EditRedirections.aspx" + base.GetBaseQueryString()); } catch (Exception ex) { ShowError("Error saving url: " + ex.Message); } }
protected void Page_Load(object sender, EventArgs e) { UrlId = Int32.Parse(Request.QueryString["FileId"]); if (UrlId > 0) { Url = RedirectionModule.GetbyId(UrlId); if (!IsPostBack) { BindUrl();// I HATE WebForms } btnDelete.Visible = true; btnDelete.Attributes.Add("onclick", "return confirm('Are you sure?');"); } else { Url = new RedirectionUrl { Section = RedirectionModule.Section }; calDatePublished.SelectedDate = DateTime.Now; btnDelete.Visible = false; } }
public void btnDelete_Click(object sender, System.EventArgs e) { RedirectionModule.Delete(Url); Context.Response.Redirect("EditRedirections.aspx" + base.GetBaseQueryString()); }