Check if user control in edit mode
Posted on: Wed Jun 03 11:05:57 -0700 2009. Updated on: Wed Jun 03 11:09:23 -0700 2009.
Category: Telerik Controls and Sitefinity
Category: Telerik Controls and Sitefinity
In Sitefinity, we sometimes want to be able to know if a custom user control we have built is in edit mode, ie when you are in the designer. This can be useful to not execute javascript or not draw certain things that would mess up the usability / cause errors in the designer. It is quite easy, we are basically checking for the querystring cmspagemode.
string mode = Request.Querystring.Get("cmspagemode");
if(mode != null)
{
// running in SF preview mode
if(mode == "edit")
{
// running in edit mode
}
}
Thu Mar 11 03:56:06 -0800 2010
fg
---------------------------------------------------
Thu Mar 11 03:56:26 -0800 2010
Bakwas
---------------------------------------------------