Like in topic.

How to determine in a client web part (on remote web) if a page that the web part is placed on, is in edit mode? if it is possible??


  • SharePoint 2013 - writing Client Web Part I mean App Part used in Provider-hosted App
    – quest
    Commented May 29, 2013 at 12:31
  • check this link out if it helps, sharepoint.stackexchange.com/questions/12792/… Commented May 29, 2013 at 12:31
  • this is good solution when you developing sharepoint solutions. In SharePoint App it doesn't work because page that is displayed in web part is hosted outside of sharepoint so it hasn't SharePoint's context....
    – quest
    Commented May 29, 2013 at 12:54
  • if the page isn't in SharePoint context then how user edit's it ? Commented May 29, 2013 at 13:04

1 Answer 1


You can determine if your client web part is in edit mode (when your client web part is being edited).

Unfortunately there is no way to determine if the host web page is being edited. There is a blog post about it at sharapointalist.com

What you have to do is to add an additional token to your client web part:


<ClientWebPart Name="ClientWebPart" 
               DefaultWidth="600" DefaultHeight="300">

  <Content Type="html" 
       Src="~appWebUrl/Pages/DemoPage.aspx?{StandardTokens}&amp;editmode=_editMode_" />



Then you have to get this editmode query string, you can do it with getQueryStringParameter function which is "shipped" within the default sharepoint app template in Visual Studio:

function getQueryStringParameter(paramToRetrieve) {
    var params =
    var strParams = "";
    for (var i = 0; i < params.length; i = i + 1) {
        var singleParam = params[i].split("=");
        if (singleParam[0] == paramToRetrieve)
            return singleParam[1];

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.