mike_f1:
Hi Adam,
Sorry for a late reply, I was called to some other projects. This code seems to work but this is not what I am after. Our application must be able to display an editor from the code-behind file and not from within the html page.
Any suggestions?
Mike
Mike,
Just move the following code into your aspx code-behind file:
<script runat="server">
int count = 1;
void IterateThroughChildren(Control parent)
{
foreach (Control c in parent.Controls)
{
if (c.GetType().ToString().Equals("CuteEditor.Editor") &&
c.ID == null)
{
((CuteEditor.Editor) c).Text = "Editor " + count.ToString();
((CuteEditor.Editor) c).AutoConfigure = AutoConfigure.Simple;
((CuteEditor.Editor) c).Height = 200;
((CuteEditor.Editor) c).ThemeType = ThemeType.Office2003_BlueTheme;
count++;
}
if (c.Controls.Count > 0)
{
IterateThroughChildren(c);
}
}
}
void CreateEditors(Object sender, EventArgs e)
{
if (!Page.IsValid) return;
int n = Int32.Parse(txtTBCount.Text);
// now, create n Editors, adding them to the PlaceHolder EditorsHere
for (int i = 0; i < n; i++)
{
EditorsHere.Controls.Add(new CuteEditor.Editor());
}
// now, set the Text property of each CuteEditor.Editor
IterateThroughChildren(this);
}
</script>
asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
asp wysiwyg html editor: http://cutesoft.net/ASP
asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
Live Support: http://cutesoft.net/live-support/default.aspx