Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
AI OnAI Off
Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
public ViewMode CurrentViewMode
{
get
{
if (Request.UrlReferrer != null)
{
string startUrl = Request.UrlReferrer.ToString();
string editMatchString = "/" + Configuration.EditDir;
string adminMatchString = "/" + Configuration.AdminDir;
bool isAdmin = Regex.IsMatch(startUrl, adminMatchString, RegexOptions.IgnoreCase);
bool isEdit = Regex.IsMatch(startUrl, editMatchString, RegexOptions.IgnoreCase);
if (isAdmin)
return ViewMode.Admin;
else if (isEdit)
return ViewMode.Edit;
}
return ViewMode.View;
}
}
.. and ..
public enum ViewMode {
Edit,
Admin,
View
};