Thanks for the response. Just to be clear, your condition
(!this.IsLiveSite || (!RequestHelper.IsPostBack() && this.IsLiveSite)) is identical to
(!this.IsLiveSite || !RequestHelper.IsPostBack()) which you'll see in the second part of my question is what I already have.
Howerver, the web part is reporting
IsLiveSite to be
true even when I'm editing in the Kentico UI. That's the problem.
At the moment I'm using the following condition which seems to be working fine:
(!RequestHelper.IsPostBack() || this.PagePlaceholder.ViewMode != CMS.PortalEngine.ViewModeEnum.LiveSite)
But I'm curious about why
IsLiveSite would be true in cases when I'm not on the live site.