Detecting Edit Mode
How would I go about detecting, in the master page, if a page was in edit mode? And if it were in edit mode, how would I apply alternate css? The issue I have is that an attribute I need in the css of the site to achieve the client's design is causing some issues in edit mode. I would just like to detect at the master page level if the content page is in edit mode, and if so, apply alternate css.
Thanks in advance,
BB
** Update
Ok, so I know how to detect if in edit mode, I just am not sure of how to apply alternate css.
Hello Brett,
You could use the following code snippet in the <head> section of your .master file:
<%
if
(InDesignMode) %>
<link rel=
"Stylesheet"
type=
"text/css"
href=
"Css/Css1.css"
/>
<%
else
%>
<link rel=
"Stylesheet"
type=
"text/css"
href=
"Css/Css2.css"
/>
<% %>
Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>
You`ll need to do this:
using
Telerik.Sitefinity.Model;
protected
void
Page_Load(
object
sender, EventArgs e)
if
(
this
.IsDesignMode())