I tried following one :
GeneralConnection gc = ConnectionHelper.GetConnection();
string content = CMS.PortalEngine.PageInfoProvider.GetPageInfo(CMSContext.CurrentSiteName, CMSContext.CurrentAliasPath, CMSContext.CurrentPageInfo.DocumentCulture, null, gc.IsOpen()).EditableItems["editableHeading"];
But it is always giving null...
Design of webpart is as follows:
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="3RowsNews.ascx.cs" Inherits="CMSWebParts_TAC_3RowsNews" %>
<li>
<p>
<strong>
<cms:CMSEditableRegion ID="editableHeading" runat="server" RegionType="HtmlEditor"
DialogHeight="30" RegionTitle="Heading" EnableViewState="false" HtmlAreaToolbarLocation="Out:FCKToolbar"
InheritContent="true" />
</strong>
</p>
<p class="fixedHeightText">
<cms:CMSEditableRegion ID="editableContent" runat="server" RegionType="HtmlEditor"
DialogHeight="80" RegionTitle="Content" EnableViewState="false" HtmlAreaToolbarLocation="Out:FCKToolbar"
InheritContent="true" />
</p>
<div class="activity-news-image">
<cms:CMSEditableRegion ID="editableImage" runat="server" RegionType="HtmlEditor"
DialogHeight="80" RegionTitle="Image" EnableViewState="false" HtmlAreaToolbarLocation="Out:FCKToolbar"
InheritContent="true" />
</div>
</li>
Code behind is :
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using CMS.PortalControls;
public partial class CMSWebParts_TAC_3RowsNews : CMSAbstractWebPart
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Page_Init(object sender, EventArgs e)
{
this.editableHeading.ID = "Heading_" + this.ID;
this.editableContent.ID = "Content_" + this.ID;
this.editableImage.ID = "Image_" + this.ID;
}
}