In a webpart I'm trying to detect if the webpart is the one being edited when the web part page is in displaymode "EditDisplayMode", ie if it is the properties of the currenty executing webpart that is being shown or modified in the properties
I have no problem detecting the page displaymode...the problem is to see if its the currently executing webpart that is being edited.
I tried using the webpart properties DesignMode (returns false) and the deprecated BrowserDesignMode (returns true), so far so good, but it if I mount 2 webparts on the same page these properties shows the same values for both webparts regardless of wich
one is being edited. Btw the SPWebpartManager.Displaymode shows "EditDisplayMode".
Below is the code and the output of the webparts mounted in a page containing 2 identical webparts, after I selected "Edit shared webpart" on the first webpart.
public class DisplayModesTestPart : Microsoft.SharePoint.WebPartPages.WebPart
protected bool editModeChanged = false;
protected override void OnEditModeChanged(EventArgs e)
editModeChanged = true;
protected override void Render(HtmlTextWriter writer)
View Complete Post