Using the episerver api how do you determine if you are in edit mode if not? And no I do not want to determine this by looking at querystring.
The reason I am wanting this is because I want to assign role permissions to property types, not just at page type level.
There is currently no other way to determine if a page is in episervers edit mode than looking at the request. You can always investigate if the current page is read only or not to see if the page is beeing edited though. Another aproach is to use a control adapter to hide certain properties for a user. Here is some code to get started. You also have to register the control adapter in the app_browsers\adaptermappings.browser file by adding the following row:
Hi Sam,
have you tried checking the url? e.g.
if (HttpContext.Current.Request.UrlReferrer != null)
{
mode = Regex.IsMatch(HttpContext.Current.Request.UrlReferrer.LocalPath, "/admin/|/edit/", RegexOptions.IgnoreCase);
}
return mode;
Hi Sam,
have you tried checking the url? e.g.
if (HttpContext.Current.Request.UrlReferrer != null)
{
mode = Regex.IsMatch(HttpContext.Current.Request.UrlReferrer.LocalPath, "/admin/|/edit/", RegexOptions.IgnoreCase);
}
return mode;