TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
chaitanya sai
NA
20
1.7k
Dynamically Add telerik editor div on asp.net c# button clic
May 24 2018 2:05 AM
in my requirement i have telerik editor, i have to add that telerik editor dynamically when we click on add button. Ex: if we click that button multiple times that editor add multiple times. I tried but i didnt get output. please help me. below is my tried code.
<
form
id
=
"form1"
runat
=
"server"
>
<
div
id
=
"HtmlEditorDiv"
>
<
div
class
=
"demo-containers"
>
<
div
class
=
"demo-container"
>
<
telerik:RadScriptManager
runat
=
"server"
ID
=
"RadScriptManager1"
/>
<
telerik:RadEditor
ID
=
"RadEditor1"
runat
=
"server"
Width
=
"100%"
Height
=
"500px"
ToolbarMode
=
"RibbonBar"
EnableTrackChanges
=
"True"
ToolsFile
=
"~/tools.xml"
EnableComments
=
"True"
EditModes
=
"Design,Preview"
>
</
telerik:RadEditor
>
</
div
>
</
div
>
</
div
>
<
asp:Button
ID
=
"btnAdd"
runat
=
"server"
Text
=
"Add Button"
OnClick
=
"btnAdd_Click"
/>
<
div
id
=
"divTextBox"
style
=
"border-color: Background; border-width: thick;"
runat
=
"server"
>
</
div
>
</
form
>
Aspx.cs file code
protected
void
btnAdd_Click(
object
sender, EventArgs e)
{
// System.Web.UI.HtmlControls.HtmlGenericControl createDiv =
//new System.Web.UI.HtmlControls.HtmlGenericControl("div");
// createDiv.ID = "createDiv";
// createDiv.InnerHtml = "<telerik:RadScriptManager runat='server' ID='RadScriptManager1' /><telerik:RadSkinManager ID = 'RadSkinManager1' runat = 'server' ShowChooser = 'true' /><div class='demo-containers'><div class='demo-container'><telerik:RadEditor RenderMode = 'Lightweight' runat='server' ID='RadEditor1' SkinID='DefaultSetOfTools' Height='675px'></telerik:RadEditor></div></div><telerik:RadAjaxLoadingPanel runat = 'server' ID='RadAjaxLoadingPanel1'></telerik:RadAjaxLoadingPanel>";
// this.Controls.Add(createDiv);
//TextBox textName;
//textName = new TextBox();
//textName.TextChanged += new EventHandler(textName_TextChanged);
HtmlGenericControl div1 =
this
.FindControl(
"divTextBox"
)
as
HtmlGenericControl;
string
Editoro=
"<div id='HtmlEditorDiv1'><div class='demo-containers'><div class='demo-container'><telerik:RadEditor ID='RadEditor11' runat='server' Width='100%' Height='500px' ToolbarMode='RibbonBar' EnableTrackChanges='True'ToolsFile='~/tools.xml' EnableComments='True' EditModes='Design,Preview'></telerik:RadEditor></div></div></div>"
;
div1.InnerHtml = Editoro;
div1.Visible =
true
;
}
Reply
Answers (
0
)
After updation of framework 3.5 to 4
Convert PDF to Word using C# for winform