Save Button Customization

Last post 01-28-2007, 4:11 PM by marker. 4 replies.
Sort Posts: Previous Next
  •  01-28-2007, 1:48 PM 26201

    Save Button Customization

    Recently load Cute Editor and got questions.

    I would like to save data form editor to my Data base when I click Save button. With free test download seems like I did not get all the code-behind files. Do I need code-behind to run my code to save data or there is other ways to set Save button to ran my code? If I need code source how where would I get it? And what exactly the place to make changes for Seve Button. I do not want to by any products before I know it going to work. And all that for asp.net 2.0 web site.

    I appreciate any help.

  •  01-28-2007, 2:23 PM 26202 in reply to 26201

    Re: Save Button Customization

    >>With free test download seems like I did not get all the code-behind files.

    It contains all the necesaary code.
     
     
    >>Do I need code-behind to run my code to save data
     
    No.  If you like, you can put the following code into your code-behind file.
     
     void Page_Load(object sender, System.EventArgs e)
      {
         if (IsPostBack)
      {
       Literal1.Text = "<h2>The HTML you typed is...</h2><br>";
       Literal1.Text += Server.HtmlEncode(Editor1.Text);
         }
      else
      {
       Editor1.Text = "Type Here";
      }
     
     }
     public void Submit(object sender, System.EventArgs e)
     {
      Literal1.Text = "<h2>The HTML you typed is...</h2><br>";
      Literal1.Text += Server.HtmlEncode(Editor1.Text);
     }
     
     
    >> there is other ways to set Save button to ran my code?
     
    Yes.
     
    Try the following example:
     
    <%@ Page Language="C#"%>
    <%@ Register TagPrefix="CE" Namespace="CuteEditor" Assembly="CuteEditor" %>
    <html>
     <body>
            <form runat="server" ID="Form1">                       
            <CE:Editor id="Editor1" OnTextChanged="Submit" runat="server" ></CE:Editor>
            <asp:Literal ID="Literal1" Runat="server" />
      </form>
     </body>
    </html>
    <script runat="server">
     public void Submit(object sender, System.EventArgs e)
     {
         // do page validation here.....
     
         Literal1.Text = "<h2>The HTML you typed is...</h2><br>"; 
         Literal1.Text += Server.HtmlEncode(Editor1.Text);
     }
    </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

  •  01-28-2007, 3:06 PM 26205 in reply to 26202

    Re: Save Button Customization

    First of all thank you so mach for so quick response.

    But I was talking about using your save button (the one you got in your tool bar) and not put additional “add” & “submit” ones on a page (I’m trying to keep all control buttons together). Is there any way to run my “save data” code by clicking your save button from tool bar.

  •  01-28-2007, 3:19 PM 26206 in reply to 26205

    Re: Save Button Customization

    >>Is there any way to run my “save data” code by clicking your save button from tool bar.
     
    Please check the two example code I wrote for you.
     
    Just replace the logic with your own code.

    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

  •  01-28-2007, 4:11 PM 26209 in reply to 26206

    Re: Save Button Customization

    Thanks a lot.

View as RSS news feed in XML