Topbar
Topbar
Sign in
|
Join
|
Client Center
Home
Products
Client Center
Contact
Purchase
Support forums
»
Products
»
Cute Editor for .NET
»
Re: function CuteEditor_OnCommand
Re: function CuteEditor_OnCommand
06-08-2009, 1:20 AM
Kenneth
Joined on 02-13-2008
Posts 3,886
Re: function CuteEditor_OnCommand
Reply
Quote
Hi goh6613,
Please try this example
<%@ Page Language=
"C#"
%>
<%@ 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
void
button1_Click(
object
sender, EventArgs e)
{
editor1.Visible =
true
;
editor2.Visible = !editor1.Visible;
editor1.Text =
"editor1"
;
}
protected
void
button2_Click(
object
sender, EventArgs e)
{
editor2.Visible =
true
;
editor1.Visible = !editor1.Visible;
editor2.Text =
"editor2"
;
}
</script>
<html xmlns=
"http://www.w3.org/1999/xhtml"
>
<head runat=
"server"
>
<title>Untitled Page</title>
</head>
<body>
<form id=
"form1"
runat=
"server"
>
<div>
<asp:Button ID=
"button1"
runat=
"server"
Text=
"ShowEditor1"
OnClick=
"button1_Click"
/>
<asp:Button ID=
"button2"
runat=
"server"
Text=
"ShowEditor2"
OnClick=
"button2_Click"
/>
<CE:Editor ID=
"editor1"
runat=
"server"
Visible=
"false"
>
</CE:Editor>
<CE:Editor ID=
"editor2"
runat=
"server"
Visible=
"false"
>
</CE:Editor>
</div>
</form>
</body>
</html>
<script>
function CuteEditor_OnCommand(editor,command,ui,value)
{
alert(command);
//handle the command by command name,like
// if(command=="New")
// {
// alert("New");
// return true;
// }
}
</script>
Regards,
Ken
View Complete Thread