Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Murray Roke 503 posts 966 karma points c-trib
    Aug 01, 2012 @ 05:49
    Murray Roke
    0

    How do I Force changes made on BeforeSave to show in admin UI

    How do I Force changes made on BeforeSave to show in admin UI

    Currently I'm working with Member but the problem is the same for Document

    Currently I'm thinking the solution is some hack such as reloading the whole page, perhaps having a custom DataType wich does a redirect on postback.

    Any other ideas?

  • Jigs 40 posts 63 karma points
    Aug 01, 2012 @ 06:05
    Jigs
    1

    Hi Murray,

    if you want to force changes to backend of umbraco ... then you can use ...

                 //save and publish --- d is document

                d.Publish(user);
               
                //tell the runtime to update the node cache
               
                umbraco.library.UpdateDocumentCache(d.Id);

    or you can redirect to current page like ....

                //Redirect to current page to refresh content


                Response.Redirect(Request.RawUrl);

    cheers,

    jigs

  • Murray Roke 503 posts 966 karma points c-trib
    Aug 01, 2012 @ 06:18
    Murray Roke
    0

    Awesome, that's simple enough, here's my actual code in my ApplicationBase

    Member.AfterSave += Refresh;
    private void Refresh(Member sender, SaveEventArgs e)
    {
        if (HttpContext.Current != null)
        {
            if(HttpContext.Current.Request.RawUrl.Contains("editMember.aspx"))
                HttpContext.Current.Response.Redirect(HttpContext.Current.Request.RawUrl);
        }
    }
Please Sign in or register to post replies

Write your reply to:

Draft