System.Web.HttpContext.Current.GetRequestContext().GetContextMode() return me Default when I am in Online Center ->Commerce->Catalog window. I was expecting Edit.
Is it a bug? Is there any way to find out Page Mode in while extending ContentRoute.CreatedVirtualPath .
Yes - it sounds like a bug - I can't think of reason why it does not return Edit.
I will log a bug for this for further consideration. Thank you.
I'm having some trouble reproducing this issue. I ran the following code in the template of an entry and got what I expected, i.e. "Edit" when having it open in the catalog editng view, and "Default" browsing it directly on the site.
protected override void OnLoad(System.EventArgs e)
var mode = HttpContext.Current.GetRequestContext().GetContextMode();
I tested on the latest code. Either there have been some changes between the code that you are running and the latest, or there is some timing involved, i.e. you are executing the code before the mode can be evaluated properly.
I am on EPiServer Commerce 8.1
I was trying to access that from ReplaceWithCloudUrl in post http://world.episerver.com/blogs/K-Khan-/Dates/2014/12/using-blobs-and-cdn-both-effectively/
where I need to decide that either it is front site or a call from online center. Catalog section of Online center was returning me Default, CMS Editor was returning Edit.
Thanks for the info, I'll use that and look further onto the bug.