Try our conversational search powered by Generative AI!

GetContextMode returns default in online center



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 .


Dec 05, 2014 11:46


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.


Dec 08, 2014 4:43


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.


Per Gunsarfs

Dec 11, 2014 10:06


I am on EPiServer Commerce 8.1

I was trying to access that from ReplaceWithCloudUrl in post

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.


Dec 11, 2014 11:26

Thanks for the info, I'll use that and look further onto the bug.


Per Gunsarfs

Dec 11, 2014 13:55
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.