GetContextMode returns default in online center

Vote:
 

Hi,

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 .

Regards
Khurram

#114169
Dec 05, 2014 11:46
Vote:
 

Hi,

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.

/Q

#114218
Dec 08, 2014 4:43
Vote:
 

Hi

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)
{
    base.OnLoad(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.

Regards

Per Gunsarfs

#114399
Dec 11, 2014 10:06
Vote:
 

Hi,

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.

Regards
/K

#114401
Dec 11, 2014 11:26
Vote:
 

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

Regards

Per Gunsarfs

#114408
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.