Serenity
Serenity

Reputation: 5098

How do you access Telerik RadEditor control (embedded in Content page) in master page's code behind?

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"

Upvotes: 0

Views: 675

Answers (1)

Dick Lampard
Dick Lampard

Reputation: 2266

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")

Upvotes: 1

Related Questions