Views: 5030
Number of votes: 1
Average rating:

Is page in edit mode?

I’ve seen a lot of different ways to determine if the actual page is in edit mode. Since i’m a fan of extension methods, i couldn’t resist make my own. This have to be the shortest possible way to determine if page is in edit or not :)

 

public static bool IsPageInEditMode(this PageData page)
{
  return page.WorkPageID != 0;
}

 

To find out if the page is in edit:

bool x = CurrentPage.IsPageInEditMode()
Sep 07, 2009

Please login to comment.