Hi MDCragg,
Try this way
Do not use server button to add the text, use input, like below.
- <%@ Page Language="C#" %>
-
- <%@ Register Namespace="CuteEditor" Assembly="CuteEditor" TagPrefix="CE" %>
- <%@ Register Namespace="AjaxControlToolkit" Assembly="AjaxControlToolkit" TagPrefix="AJAX" %>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-
- <script runat="server">
-
- protected void btnClose_Click(object sender, EventArgs e)
- {
- ModalPopupExtender1.Hide();
- }
- </script>
-
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head runat="server">
- <title>example</title>
- </head>
- <body>
- <form id="form1" runat="server">
- <asp:ScriptManager ID="ScriptManager1" runat="server">
- </asp:ScriptManager>
- <asp:UpdatePanel ID="UpdatePanel1" runat="server">
- <ContentTemplate>
- <asp:Button ID="btnShow" Text="Show" runat="server" />
- <AJAX:ModalPopupExtender ID="ModalPopupExtender1" runat="server" PopupControlID="panel1"
- TargetControlID="btnShow">
- </AJAX:ModalPopupExtender>
- <CE:Editor ID="editor1" runat="server">
- </CE:Editor>
- <asp:Panel ID="panel1" runat="server" BackColor="Black" Height="200px" Width="400px">
- <asp:TextBox ID="textBox1" runat="server"></asp:TextBox>
- <input type="button" onclick="addATag()" value="Add" />
- <asp:Button ID="btnClose" runat="server" Text="Close" OnClick="btnClose_Click" />
- </asp:Panel>
- </ContentTemplate>
- </asp:UpdatePanel>
- </form>
- </body>
- </html>
-
- <script type="text/javascript">
-
- function addATag()
- {
- var editor1=document.getElementById('<%= editor1.ClientID %>');
-
-
-
- var DisplayText = document.getElementById('<%= textBox1.ClientID %>').value;
-
-
- var HyperLinkMarkUp = '<a href="#" target="_blank">' + DisplayText + '</a>';
-
- editor1.ExecCommand('PasteHTML',false,HyperLinkMarkUp);
-
- }
- </script>
Regards,
Ken