Topbar
Topbar
Sign in
|
Join
|
Client Center
Home
Products
Client Center
Contact
Purchase
Support forums
»
Products
»
Cute Editor for .NET
»
Re: getting the content of Editor1.Text; blank
Re: getting the content of Editor1.Text; blank
05-04-2010, 2:21 AM
Kenneth
Joined on 02-13-2008
Posts 3,886
Re: getting the content of Editor1.Text; blank
Reply
Quote
Hi svk and sade1125,
Try the example below
<%@ Page Language=
"VB"
ValidateRequest=
"false"
%>
<%@ Register TagPrefix=
"CE"
Namespace
=
"CuteEditor"
Assembly
=
"CuteEditor"
%>
<!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
>
<script runat=
"server"
>
Protected
Sub
button1_Click(
ByVal
sender
As
Object
,
ByVal
e
As
System.EventArgs)
Dim
editorText = tbServer.Text
label1.Text = editorText
End
Sub
</script>
<html xmlns=
"http://www.w3.org/1999/xhtml"
>
<head runat=
"server"
>
<title>Untitled Page</title>
</head>
<body>
<form id=
"form1"
runat=
"server"
>
<div>
<CE:Editor ID=
"editor1"
runat=
"server"
>
</CE:Editor>
<asp:Button ID=
"button1"
runat=
"server"
Text=
"Get editor text"
OnClientClick=
"GetEditorText()"
OnClick=
"button1_Click"
/><br />
<asp:TextBox ID=
"tbServer"
runat=
"server"
></asp:TextBox>
<asp:Label ID=
"label1"
runat=
"server"
></asp:Label>
</div>
</form>
</body>
</html>
<script>
var editor1=document.getElementById(
"<%= editor1.ClientID %>"
);
var tbServer=document.getElementById(
"<%= tbServer.ClientID %>"
);
function GetEditorText()
{
tbServer.value=editor1.getHTML();
}
</script>
Regards,
ken
View Complete Thread