Skip to content
Discussion options

You must be logged in to vote

You can use ContentHandlerBase to add the new created ContentItem to the HttpContext.Feature collection and then use a filter to access that new contenItem with something like this

public class CustomContentHandler : ContentHandlerBase
{
    public override Task CreatedAsync(CreateContentContext context)
    {
        if(context.ContentItem.ContentType == "CustomType")
        {
        	// either this
        	_httpContentAccessssor.HttpContext.Request.Query["ReturnUrl"] = "";

        	// or do this and use an action filter to read it and change the ReturnUtr later.
        	_httpContentAccessssor.HttpContext.Features.Set(new NewContentItemFeature(context.ContentItem))

        }
    }
}

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@PiemP
Comment options

@MikeAlhayek
Comment options

Answer selected by PiemP
@MikeAlhayek
Comment options

@PiemP
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants