tother,
You code should work.
<%@ Register TagPrefix="CE" Namespace="CuteEditor" Assembly="CuteEditor" %>
<%@ Page language="c#"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<script language="JavaScript" type="text/javascript" >
function ShowMyDialog(button)
{
//use CuteEditor_GetEditor(elementinsidetheEditor) to get the cute editor instance
var editor=CuteEditor_GetEditor(button);
//show the dialog page , and pass the editor as newwin.dialogArguments
var newwin=showModalDialog("My_Custom_Text.html?_rand="+new Date().getTime()
,editor,"dialogWidth:400px;dialogHeight:240px");
}
</script>
<html>
<head>
<title>title>
<link rel="stylesheet" href="../../example.css" type="text/css" />
</head>
<body >
<form runat="server" ID="Form1">
<h2>How to create a custom button which displays a dialog?</h2> <hr>
<CE:Editor id="Editor1" runat="server" AutoConfigure="Minimal"></CE:Editor><br />
</form>
</body>
</html>
<script runat="server">
private void Page_Load(object sender, System.EventArgs e)
{
//about Italic, see Full.config
//<item type="image" name="Italic" imagename="Italic" />
//get the pos after the Italic
int pos=Editor1.ToolControls.IndexOf("Italic")+1;
//Themes/%ThemeName%/Images/text.gif
WebControl ctrl=Editor1.CreateCommandButton("MyButton","text.gif","Insert My Custom Text");
ctrl.Attributes["onclick"]="ShowMyDialog(this)";
//add this custom button into the editor
Editor1.InsertToolControl(pos,"MyButton",ctrl);
}
</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