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 a div that is created by Ajax with .append(html) function, I'm trying
I am currently trying to add the WMD editor to my site. I have
i have animated div in html. it is adding 1px to div in every
in my html page I have div with css: padding: 0px; color: rgb(51, 51,
Normally when you have a div created in html. You can check its width
I have a div element in an HTML document. I would like to extract
I have created a simple layout using the HTML div tag. I would like
I have a div directly under the body. My HTML looks like this: <body>
If I have 2 div tags: <div id=parentDiv> <div id=childDiv><!-- other html --></div> <!--
In the following HTML page, I have a div, which contains two spans (

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.