我有以下代码:
public class CustomContentBlock : ContentBlock
{
public override void Fill()
{
this._Item.Html = replace_dangerous_entities(this._Item.Html);
base.Fill();
}
}
public class ContentBlock : EkXsltWebPart, IEnumerator, IEnumerable, IListSource, IDataSource, ICallbackEventHandler
{
protected ContentBase _Item;
public override void Fill()
{
if (this.Dirty && base.CallBackCheck())
{
this._FillCount++;
if (!base.DesignTime)
{
if (this.ContentID == 0L)
{
return;
}
this.SetContentLanguage();
this.ReadCachedItem();
if (this._Item == null)
{
ApiSupport.ContentResult contentResult = base.Connection.api.LoadContent(this.ContentID, base.Connection.api.CmsPreview, this.GetAnalyticsData);
if (contentResult.Item != null && Convert.ToInt64(contentResult.Item.ContentType) == 102L)
{
string pattern = "scrolling=\"yes\"";
contentResult.Item.Html = Regex.Replace(contentResult.Item.Html, pattern, "");
}
if (contentResult.Item != null && contentResult.Item.ContentType == EkEnumeration.CMSContentType.Multimedia && base.Connection.api.CmsPreview && contentResult.Item.Status.ToString().ToUpper() != "A")
{
string oldValue = string.Concat(new string[]
{
base.Connection.api.RequestInformationRef.AssetPath,
base.Connection.api.EkContentRef.GetFolderParentFolderIdRecursive(contentResult.Item.FolderId).Replace(",", "/"),
"/",
contentResult.Item.AssetInfo.Id,
".",
contentResult.Item.AssetInfo.FileExtension
});
contentResult.Item.Html = contentResult.Item.Html.Replace(oldValue, string.Concat(new string[]
{
base.Connection.api.SitePath,
"assetmanagement/DownloadAsset.aspx?history=true&ID=",
contentResult.Item.AssetInfo.Id,
"&version=",
contentResult.Item.AssetInfo.Version
}));
}
this.ResetContentLanguage();
if (contentResult.ErrorMessage != string.Empty)
{
throw new Exception(contentResult.ErrorMessage);
}
this._Item = contentResult.Item;
base.NormalizeBase(ref this._Item);
if (this._Item != null && !contentResult.Item.IsPrivate && Cache.Cacheable(false))
{
Cache.PutCache(this._identifier, this._Item, this.CacheInterval);
}
}
this.CreateDataSet();
base.CatalogIconImageUrl = base.Connection.api.ApplicationPath + "images/application/icon_document.gif";
base.TitleIconImageUrl = "";
base.Title = this._Item.Title;
}
this.BuildOutput();
base.SetClean();
}
}
}
但我总是收到错误消息stackoverflowexception occurred in mscorlib.dll
base.Fill();
班级ContentBlock
不是我们写的。