Save instance?

Last post 02-24-2004, 5:15 PM by Adam. 7 replies.
Sort Posts: Previous Next
  •  02-22-2004, 12:41 PM 426

    Save instance?

    i Know that im a n00b but what are the instance raised by the save button ???
  •  02-23-2004, 6:16 AM 430 in reply to 426

    Re: Save instance?

    ok let me ask in another way

     

    How do i save the text into the ?????

     

  •  02-23-2004, 8:48 AM 431 in reply to 430

    Re: Save instance?

    Word missing from last post: Database?

     

  •  02-23-2004, 5:33 PM 435 in reply to 431

    Re: Save instance?

    emma,

     

    There is nothing special about saving data to the database on our CuteEditor control  than a regualr textbox.

     

    In your codebehind or server side code,  just retrieve your data from cuteeditor1.text property and add the data to your event handler on this Page is used to save/ the text changes to the database.

     

    Below is an example:

     

    //****************************************************************

    //

    // The UpdateBtn_Click event handler on this Page is used to save

    // the text changes to the database.

    //

    //****************************************************************

    private void UpdateBtn_Click(Object sender, EventArgs e) {

           // Create an instance of the HtmlTextDB component

           Portal.HtmlTextDB text = new Portal.HtmlTextDB();

         
           // Update the text within the HtmlText table

           text.UpdateHtmlText(moduleId, Server.HtmlEncode(Editor1.Text));

    }

     

    Hope it helps.


    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

  •  02-24-2004, 4:09 AM 437 in reply to 435

    Re: Save instance?

    Thx Adam

     

    Exactly what i needed

  •  02-24-2004, 4:41 AM 438 in reply to 435

    Re: Save instance?

    Ohh well Adam i was a little to fast there again.

    When i click the save button in cute editor.

    Which event is raised?

    you wrote:

     

    private void UpdateBtn_Click(Object sender, EventArgs e) {

           // Create an instance of the HtmlTextDB component

           Portal.HtmlTextDB text = new Portal.HtmlTextDB();

         
           // Update the text within the HtmlText table

           text.UpdateHtmlText(moduleId, Server.HtmlEncode(Editor1.Text));

    }

     

    and i want to know what i should write instead of the highlighted text, when i use the save button build in the cute editor.

     

    Thx i advance

  •  02-24-2004, 3:20 PM 445 in reply to 438

    Re: Save instance?

    At the moment im using the:

     

    If ispostback = true then
    editor.text = Call to database component.
    End If

     

    But i dont want to open a db conn everytime the page is posted back everytime

     

  •  02-24-2004, 5:15 PM 447 in reply to 445

    Re: Save instance?

    emma,

     

    You can usually just check if the page is posting back, as normally the save button is the only button on the CuteEditor that posts back:

    if(Page.IsPostBack)

           // Save it.
    }
    else

           // do something else if need be.
    }

     

    You can also disable this save button and create your own submit button.

     

    Here is an example:

     

    <%@ Page Language="C#" %>

    <%@ Register TagPrefix="CE" Namespace="CuteEditor" Assembly="CuteEditor" %>

    <html>

         <head>

         </head>

    <body>

           <form runat="server" ID="Form1">

                 <CE:Editor id="Editor1" runat="server"></CE:Editor>

                 <br>

                <asp:Button id="btnUpdate" onclick="Submit" Runat="server" Text="Submit"></asp:Button>

           </form>

    </body>

    </html>

    <script runat="server">

            public void Submit(object sender, System.EventArgs e)

           {

             // Save the data to database here

           }

    </script>

     

     

    But i dont want to open a db conn everytime the page is posted back everytime

     

    You can't avoid open a db connection.  Even with your own submit button, the page is posted back as well.

     


    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 as RSS news feed in XML