P.M*_*hna -2 c# asp.net tridion
我正在自定义功能区工具栏并为其添加一个按钮.每当我点击该按钮时,它将打开一个aspx页面,允许作者选择一些数据,这些数据会附加到现有的RTF字段内容中.
但是当弹出窗口打开时,它在浏览器(Internet Explorer)中出现以下错误.
我在代码隐藏文件中继承了Tridion页面.当我尝试使用Response.Write()函数时,它会给出类似"Expected;"的错误.请告诉我它之所以给出错误的原因是什么?早期的回应表示赞赏.提前致谢.
PFB相关代码:文件内容后面的Aspx页面代码:
namespace ButtonReference.Popups
{
[ControlResourcesDependency(new Type[] { typeof(Popup), typeof(Tridion.Web.UI.Controls.Button), typeof(Stack), typeof(Dropdown), typeof(List) })]
[ControlResources("RTFExtensions.ButtonReferenece")]
public partial class PopupReference : TridionPage
{
protected override void OnInit(EventArgs e)
{
base.OnInit(e);
TridionManager tm = new TridionManager();
tm.Editor = "PowerTools";
System.Web.UI.HtmlControls.HtmlGenericControl dep = new System.Web.UI.HtmlControls.HtmlGenericControl("dependency");
dep.InnerText = "Tridion.Web.UI.Editors.CME";
tm.dependencies.Add(dep);
System.Web.UI.HtmlControls.HtmlGenericControl dep2 = new System.Web.UI.HtmlControls.HtmlGenericControl("dependency");
dep2.InnerText = "Tridion.Web.UI.Editors.CME.commands";
tm.dependencies.Add(dep2);
//Add them to the Head section
this.Header.Controls.Add(tm); //At(0, tm);
}
protected void Page_Load(object sender, EventArgs e)
{
mySession = new Tridion.ContentManager.Session(@"");
if (!Page.IsPostBack)
{
try
{
if (true)
{}
else
{
//Response.Write("Invalid schema chosen");
return;
}
}
}
}
}
Run Code Online (Sandbox Code Playgroud)
小话:由于您的页面将用作简单的弹出窗口,因此您无需加载与域模型相关的JavaScript内容.不加载它将减少页面的加载时间.为此,您需要将IsStandAloneViewTridion Manager属性设置为false:
tm.IsStandAloneView = false;
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
174 次 |
| 最近记录: |