Ejemplo n.º 1
0
    protected void DeleteButton_Click(object sender, EventArgs e)
    {
        if (!string.IsNullOrEmpty(Request.QueryString["id"]))
        {
            // TODO: Debemos eliminar el contenido almacenado por el web part manager para este url.
            _page = CodeFactory.ContentManager.Page.Load(new Guid(Request.QueryString["id"]));

            if (_page != null)
            {
                _page.Delete();
                _page.Save();
            }
        }

        Response.Redirect("~/default.aspx");
    }
Ejemplo n.º 2
0
    protected void DeleteButton_Click(object sender, EventArgs e)
    {
        WebPartManager currentWebPartManager = WebPartManager.GetCurrentWebPartManager(this.Page);

        _page = CodeFactory.ContentManager.Page.Load(new Guid(Request.QueryString["id"]));

        if (_page == null)
            return;

        _page.Delete();

        _page.AcceptChanges();

        if (_page != null)
            Response.Redirect("~/default.aspx", false);

        // esets personalization data for the current page, scope, and user in the underlying data store.
        // As a side effect of the reset, the currently executing page is re-executed by a Transfer call.
        if (currentWebPartManager.Personalization.HasPersonalizationState)
            currentWebPartManager.Personalization.ResetPersonalizationState();
    }