1

Does anyone know how to get a context rendering in Sitecore Web Forms?

There is a RenderingContext.Current.Rendering in the Sitecore MVC, but I can't seem to find the same for Web Forms

1 Answer 1

1

Oh wow, it's been a while. It isn't completely clear to me exactly what you are after, but I believe this might be helpful to you.

var renderingReference = Sitecore.Context.Page.GetRenderingReference(this);

Where 'this' would be your current page control. It might be that you need to do this.Parent (to get the actual Sublayout responsible for rendering your control) - I unfortunately don't have a Webforms based solution nearby to test.

1
  • Thanks, Mark. The need has been gone already, but I will keep the question, in case somebody is to deal with the same thing Sep 16, 2017 at 15:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.