ajax| Data | database | refresh | No refresh Cuteeditor really is a good web online editor, but the 5.0 installation and the previous version is a little different, 5.0 of the cracked version of the download address is: Http://www.seaskyer.net, Download after the decompression bar, this earth people know.
Let's create a new Web site in vs2005. Then add cuteeditor to the tool panel. We select Choose Item in the tool panel, select browser in the dialog box, find CuteEditor.dll, Sure you can pull it all the way.
Let's add a edit.asxp and drag the editor from the tool panel onto the page. This time the authorization file cuteeditor.lic should also be automatically to the bin directory, if not we have to manually bake in. This time, if we compile directly, it's not possible. , it prompts for an error, because 5.0 adds a editorimage function, so we have to put CuteEditor.ImageEditor.dll and NetSpell.SpellChecker.dll (the reason for grilling this is to turn on the spelling checker by default) are baked into the bin directory of the project, and we also have to copy all the uncompressed cutesoft_client directories to the root directory of the application. There should be no errors when compiling this time, if there are any Windows Integrated authentication errors, So we're going to modify the configuration in IIS, there is a directory security in the properties of this site in IIS, and then the edit of authentication and access control, the little hook in front of the Integrated Windows authentication.
The above is just a simple installation, as well as control cueeditor display, has security and that what upload ah, and control the user upload directory Ah, or to each user to build their own picture directory Ah, but also have to set up a different, If possible I write another. Here we're going to start using ajax.net to insert the contents of the Cuteeditor into the database pull.
For more information on how to install ajax.net, see my other cheat article: Ajax.NET QuickStart.
How do I insert the contents of Cueeditor into the database with Ajax? First, the key is to get Cuteeditor's client ID, which can be done via <%=Editor1.ClietID%> To get. And how to get the contents of editor inside the client. This can use his inner JavaScript api,gethtml (), which is HTML. Here is an HTML button code that inserts the contents of the Cuteeditor into the database:
Next is a JS script: We assume that editor's ID is Editor1
Let's look at the AJAX approach to the server segment:
[Ajaxpro.ajaxmethod]
public string Inserteditor (string insertstr)
{
String connstr = system.configuration.configurationmanager.appsettings["ConnString"]. ToString ();
SqlConnection conn = new SqlConnection (CONNSTR);
String cmdstr = "INSERT into usercontent (this_content,this_name) VALUES (@content, @name)";
SqlCommand comm = new SqlCommand (cmdstr,conn);
2005 inside the parameter to assign a value simple Dora!!
Comm. Parameters.addwithvalue ("@content", insertstr);
Comm. Parameters.addwithvalue ("@name", "Pwqzc");
Conn. Open ();
Try
{
Comm. ExecuteNonQuery ();
return "OK";
}
Catch
{
Return to "bad";
}
Finally
{
Conn. Close ();
}
Run, we write a bit of content into the cuteeditor inside, click the button, he put the data into the pull!!!
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.