如何访问母版页代码后面的 Telerik RadEditor 控件(嵌入在内容页面中)?
if (ContentPlaceHolders.Contains(Telerik.RadEditor)) { label1.Text = ("lkjjljlj!"); 上面的显然
不起作用
[编辑]尝试了以下..
if(ContentPlaceHolder1.Controls.Equals(Telerik.Web.UI.RadEditor))
{
label1.Text = ("lkjjljlj!");
}
它给出了错误“'Telerik.Web.UI.RadEditor'是一个'类型',在给定的上下文中无效”
if (ContentPlaceHolders.Contains(Telerik.RadEditor))
{
label1.Text = ("lkjjljlj!");
}
the above apparently didnt work
[edit] tried the following..
if(ContentPlaceHolder1.Controls.Equals(Telerik.Web.UI.RadEditor))
{
label1.Text = ("lkjjljlj!");
}
its giving the error "'Telerik.Web.UI.RadEditor' is a 'type', which is not valid in the given context"
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这里有一些方法可以做你想做的事:
//loop
foreach(MyContentPlaceHolder.Controls 中的 Control 控件)
{
if(typeof(control).Equals(Telerik.Web.UI.RadEditor)
{
//设置标签的文本
}
}
//如果适用的话,直接通过 id 引用编辑器
MyContentPlaceHolder.FindControl("RadEditorIDHere")
Here are a couple of methods to do what you want:
//loop
foreach (Control control in MyContentPlaceHolder.Controls)
{
if(typeof(control).Equals(Telerik.Web.UI.RadEditor)
{
//set the text of the label
}
}
//reference the editor directly by its id, if applicable
MyContentPlaceHolder.FindControl("RadEditorIDHere")