3

Is there a generic way to get the HTML page source of the current Sitecore.Context.Item without downloading it, so, it will cover all (WebForms/Sitecore.Mvc/JSS etc.) scenarios?

Is it possible to get the HTML page source somewhere in pipeline processors etc.?

5
  • If you are looking for a solution which will cover all Sitecore implementation type then good to create REST API which use WebClient to return page HTML by passing the Page url codegrepper.com/code-examples/html/…
    – Amit Kumar
    Sep 26 at 17:35
  • Thanks, @AmitKumar, but I'm wondering if it is possible to get an HTML source of the current context item somewhere in Sitecore pipelines, etc.
    – Alexander
    Sep 27 at 9:38
  • In pipeline once item resolved then using WebClient you can get html based upon your page template
    – Amit Kumar
    Sep 29 at 20:41
  • A assume it will lead to a circular issue: 1. Requesting mystites/itemA 2. Context item is itemA 3. Downloading mystites/itemA somewhere in httpRequestBegin, httpRequestEnd or httpRequestProcessed, but it will redirect to p. 1, right?
    – Alexander
    Sep 30 at 8:34
  • Yes. Due to this in first place I told it to be outside of Sitecore. Every request will come to your pipeline, you may be store page item in session and place filter with page item template type.
    – Amit Kumar
    Sep 30 at 9:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.