Re: Save Button Customization

  •  01-28-2007, 2:23 PM

    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

View Complete Thread