Can i able to open popup window custom control click?

Last post 11-15-2009, 9:42 PM by Kenneth. 9 replies.
Sort Posts: Previous Next
  •  09-22-2005, 3:51 AM 10891

    Can i able to open popup window custom control click?

    Hi,
     
    Can i able to open popup window (aspx page) when i click my custom button?

    Currently i am working asp.net 2.0 version with CuteEditor version 5,

    i have custom button over my cuteEditor toolbar, if i click my custom button can i able to open new aspx page as popup window then i can do some programming over the page and save to cuteEditor?

    if yes can i have coding idea?

    regards,
    Anbaz.
     
     
  •  09-22-2005, 12:10 PM 10908 in reply to 10891

    Re: Can i able to open popup window custom control click?

  •  09-22-2005, 8:46 PM 10934 in reply to 10908

    Re: Can i able to open popup window custom control click?

    Hi,
     
    Your Custom Button click which displays dialog gives me the Html page opening only , but my requirement is i want to open aspx page, so i can do some serverside programming over their and pasete to the CuteEditor...
     
    is it possible ?
     
    regards,
    Anbaz.
  •  09-22-2005, 8:52 PM 10935 in reply to 10934

    Re: Can i able to open popup window custom control click?

    Anbaz,
     
    That example just shows you how to open a dialog page.
     
    You can change it to meet your own requirements.
     
    For example, open an aspx page instead of htm page.
     
     

    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

  •  09-22-2005, 9:20 PM 10936 in reply to 10935

    Re: Can i able to open popup window custom control click?

    Hi,
     
    fine, i open my aspx page when the custom button click, that's ok,
     
    but my aspx page have one dropdown list box with runat = server, ie <asp: dropdown list box>
     
    if i select some value from drodown list box, i try to insert over cuteeditor, but it say's javascript error
     
    how can place my asp controls selected value to cuteeditor?
     
    any code idea?
     
    regards,
    Anbaz.
  •  06-15-2006, 9:51 AM 20184 in reply to 10936

    Re: Can i able to open popup window custom control click?

    I have the same issue can anyone help me out in this
     
    Regards,
    Raghu
     
  •  06-15-2006, 3:54 PM 20197 in reply to 20184

    Re: Can i able to open popup window custom control click?

    Raghu,
    Please download the version 5.3
     
    Add a Cross Browser Modal Dialog Box to Cute Editor
    How to create a custom button(client side) which displays a dialog?( C# | VB )
    This example demonstrates how easy it can be to add your own client side buttons to the CuteEditor by creating a Cross Browser Modal Dialog Box.

    The above example uses showModalDialog. It shlould resolve the problem.
     
    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");
     }

    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

  •  11-13-2009, 6:48 AM 57111 in reply to 20197

    Re: Can i able to open popup window custom control click?


    Calling window is good, what about Dialog window?

    How to get access to CuteEditor in dialog window i.e. My_Custom_Text.html?
  •  11-13-2009, 8:00 AM 57113 in reply to 20197

    Re: Can i able to open popup window custom control click?

    are there any current examples of this that are working?  these posts are very old and all the links just send me to .net error pages.
     
    i am trying to open a custom dialog from a custom button and write html code back to the cuteeditor in the main window, but haven't been having much luck.  the examples linked off the top of your site nav don't have any source on how to do this, they just show that it can be done.
     
    any help would be appreciated.  :)
  •  11-15-2009, 9:42 PM 57152 in reply to 57113

    Re: Can i able to open popup window custom control click?

    Hi JJoyce,
     
    Example:
     
    Add a Cross Browser Modal Dialog Box to Cute Editor

    How to create a custom button(client side) which displays a dialog?( C# | VB )

    This example demonstrates how easy it can be to add your own client side buttons to the CuteEditor by creating a Cross Browser Modal Dialog Box.

     
    Source (you can find the source code in the download example too )
     
    Example download:
     
     
    Location CuteEditor_for_NET6.zip\Framework 2.0\HowTo\AddDialogs\cs
     
    aspx page
     
    1. <%@ Register TagPrefix="CE" Namespace="CuteEditor" Assembly="CuteEditor" %>   
    2. <%@ Page language="c#"%>   
    3. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >    
    4.         <script language="JavaScript" type="text/javascript" >   
    5.             function ShowMyDialog(button)   
    6.             {   
    7.                 //use CuteEditor_GetEditor(elementinsidetheEditor) to get the cute editor instance   
    8.                 var editor=CuteEditor_GetEditor(button);   
    9.                 //show the dialog page , and pass the editor as newwin.dialogArguments   
    10.                 //(handler,url,args,feature)   
    11.                 var newwin=editor.ShowDialog(null,"My_Custom_Text.html?_rand="+new Date().getTime()   
    12.                     ,editor,"dialogWidth:400px;dialogHeight:240px");   
    13.             }   
    14.         </script>   
    15.   
    16. <html>   
    17.     <head>   
    18.         <title>ASP and ASP.NET WYSIWYG Editor - How to create a custom button which displays a dialog?</title>   
    19.         <link rel="stylesheet" href="../../example.css" type="text/css" />   
    20.     </head>   
    21.     <body >   
    22.         <form runat="server" ID="Form1">     
    23.             <h2>How to create a custom button which displays a dialog?</h2> <hr>   
    24.             <br>   
    25.             In this example, first we get the location of Italic button. Then we add a custom dialog after it.   
    26.             <br><br>   
    27.             <CE:Editor id="Editor1" ThemeType="OfficeXP" AutoConfigure="Minimal" EditorWysiwygModeCss="example.css" runat="server" ></CE:Editor><br />   
    28.                        
    29.            
    30.         </form>   
    31.     </body>   
    32. </html>   
    33. <script runat="server">   
    34.     private void Page_Load(object sender, System.EventArgs e)   
    35.     {   
    36.         //about Italic, see Full.config   
    37.         //<item type="image" name="Italic" imagename="Italic" />   
    38.         //get the pos after the Italic   
    39.         int pos=Editor1.ToolControls.IndexOf("Italic")+1;   
    40.   
    41.         //Themes/%ThemeName%/Images/text.gif   
    42.         WebControl ctrl=Editor1.CreateCommandButton("MyButton","text.gif","Insert My Custom Text");   
    43.   
    44.         ctrl.Attributes["onclick"]="ShowMyDialog(this)";   
    45.        
    46.         //add this custom button into the editor   
    47.         Editor1.InsertToolControl(pos,"MyButton",ctrl);   
    48.     }   
    49. </script>  
    Dialog page
     
    1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">  
    2. <html>  
    3.     <head>  
    4.         <title>Insert Text</title>  
    5.     </head>  
    6.     <body bgcolor="#d4d0c8">  
    7.         <div align="center" style="padding:8px">  
    8.             <textarea rows="6" cols="40" id="ta" NAME="ta">Type content here</textarea>  
    9.             <br>  
    10.             <button onclick="button_click()" ID="Button1">Insert It</button>  
    11.             <button onclick="window.top.close();" ID="Button2">Close</button>  
    12.         </div>  
    13.     </body>  
    14.     <script>  
    15.     function button_click()   
    16.     {   
    17.         var editor=Window_GetDialogArguments(window);   
    18.         var ta=document.getElementById("ta");   
    19.         editor.PasteHTML(ta.value);   
    20.     }   
    21.     function Window_GetDialogArguments(win)   
    22.     {   
    23.         var top=win.top;   
    24.         if(top.dialogArguments)   
    25.             return top.dialogArguments;   
    26.         var opener=top.opener;   
    27.         if(opener==null)   
    28.             return top.document._dialog_arguments;   
    29.         return opener.document._dialog_arguments;   
    30.     }   
    31.     </script>  
    32. </html>  
     
    Regards,
     
    Ken
View as RSS news feed in XML