Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4543766
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T15:34:37+00:00 2026-05-21T15:34:37+00:00

i have a div and an html editor and trying to: add the div

  • 0

i have a div and an html editor and trying to:

  1. add the div inner html to the
    editor. (thats done)
  2. then any changes done in the editor
    is saved back in the div.

here is the backcode :

protected void Page_Load(object sender, EventArgs e) 
{
    Editor.Content = cvDiv.InnerHtml;
}

protected void preview(object sender, EventArgs e) //this is an onclick event
{
    cvDiv.InnerHtml = Editor.Content;
}

and the code for the editor:

<asp:ScriptManager runat="server" />
<cc1:Editor ID="Editor" runat="server" OnContentChanged="preview"  />
<asp:Button runat="server" ID="eButton" CssClass="eButton" Text="Edit" OnClick="Edit" />// this is the button that is supposed to save

but it doesnt work.

so what i am trying to do is save whatever changes made in the editor to the div

using asp.net 3.5, and the ajax toolkit editor.

thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T15:34:38+00:00Added an answer on May 21, 2026 at 3:34 pm

    This is an example i’ve made to show you a working code.

    ASPX

    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title></title>
    </head>
    <body>
        <form id="form1" runat="server">
            <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="true"></asp:ScriptManager>
            <asp:TextBox id="editor" runat="server" AutoPostBack="true"></asp:TextBox>
            <asp:Button ID="Save" runat="server" OnClick="SaveChange" Text="Save" />
            <asp:UpdatePanel ID="UpdatePanel1" runat="server" >
                <ContentTemplate>
                    <div id="preview" runat="server"></div>    
                </ContentTemplate>
                <Triggers>
                    <asp:AsyncPostBackTrigger ControlID="editor" EventName="TextChanged" />
                </Triggers>
            </asp:UpdatePanel>
        </form>
    </body>
    </html>
    

    ASPX.CS

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    
    public partial class _Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if(!IsPostBack) editor.Text = preview.InnerHtml;
            else preview.InnerHtml = editor.Text;
    
        }
    
        protected void SaveChange(object sender, EventArgs e)
        {
            string thingsToSave = preview.InnerHtml;
            //Save to db/file/xml   
    
        }
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following code in my file to load a div with HTML
Is it possible to format an HTML tooltip? E.g. I have a DIV with
I have some HTML and jQuery that slides a div up and down to
I have HTML code like this : <div> <a>Link A1</a> <a>Link A2</a> <a>Link A3</a>
I have a simple html page with a div. I am using jQuery to
I have html code that looks roughly like this: <div id=id1> <div id=id2> <p>some
I have an html like this: <div id=container1> <div class=dragme>drag me</div> </div> <div id=container2>
I have the following HTML node structure: <div id=foo> <div id=bar></div> <div id=baz> <div
I have a very simple html. The red div is inside the blue div
I have the following html <div id=menu> <ul class=horizMenu> <li id=active><a href=# id=current>About</a></li> <li><a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.