<% '========================================================= ' Retrieve the data from editor: ' If you specify your editor ID is "Editor1" ' Retrieve the data from editor: Request.Form("Editor1_HTMLContent") '========================================================= %> ASPEdit : Add the editor content to the database

Add the editor content to the database

This example show you the how to feed the editor with content from database and add the editor content to the database.

<% dim conn dim connstr Set conn = Server.CreateObject("ADODB.Connection") connstr="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("test.mdb") conn.Open connstr dim content if request("action")="save" then TitleField = Request.Form("TitleField") MessageField = Request.Form("Editor1_HTMLContent") sql="select TitleField,MessageField from test" set rs=server.createobject("adodb.recordset") rs.open sql,conn,3,3 rs.addnew rs("TitleField") = TitleField rs("MessageField") = MessageField rs.update response.write "Message added" response.write "
" rs.close set rs = nothing else MySQL="select top 1 * from test order by id DESC" set rs2=conn.execute(MySQL) if not rs2.eof then TitleField = rs2("TitleField") MessageField = rs2("MessageField") rs2.close set rs2=nothing end if end if %>
Title:
Message: <% Dim editor Set editor = New ASPEdit editor.ID = "Editor1" editor.Text = MessageField editor.FilesPath = "ASPEdit_Files" editor.ImageGalleryPath = "/Uploads" editor.MaxImageSize = 50 'editor.AutoConfigure = "EnableAll" 'editor.Template= "Bold,Italic,Underline" 'editor.StyleSheetPath = "/grey2.css" 'editor.Width = 740 editor.Height = 300 editor.Draw() ' Request.Form("Editor1_HTMLContent") access from other page %>