First, configure and download.
Then, put the folder in the web root directory.
OK, now you can.
The front-end code is as follows:
[Html]
<Head runat = "server">
<Title> </title>
<Script type = "text/javascript" src = "ckeditor/ckeditor. js"> </script>
</Head>
<Body>
<Form id = "form1" method = "post" runat = "server">
<Div style = "width: 500px; height: 300px;">
<Asp: TextBox ID = "txtContent" runat = "server" TextMode = "MultiLine" CssClass = "ckeditor"> </asp: TextBox>
<Asp: Button runat = "server" Text = "save" ID = "btn_ OK" onclick = "btn_ OK _Click"/>
</Div>
</Form>
</Body>
<Head runat = "server">
<Title> </title>
<Script type = "text/javascript" src = "ckeditor/ckeditor. js"> </script>
</Head>
<Body>
<Form id = "form1" method = "post" runat = "server">
<Div style = "width: 500px; height: 300px;">
<Asp: TextBox ID = "txtContent" runat = "server" TextMode = "MultiLine" CssClass = "ckeditor"> </asp: TextBox>
<Asp: Button runat = "server" Text = "save" ID = "btn_ OK" onclick = "btn_ OK _Click"/>
</Div>
</Form>
</Body>
The background code is just a simple way to get the content in TextBox. The following contains the data I used for testing and writes it into a txt text.
[Csharp]
Protected void Page_Load (object sender, EventArgs e)
{
If (! IsPostBack)
{
String strPath = "E :\\ jin \ CompanyProject \ WebSite \ Web \ txt. Txt ";
// Read:
TxtContent. Text = File. ReadAllText (strPath );
}
}
Protected void btn_ OK _Click (object sender, EventArgs e)
{
String Data = txtContent. Text;
// String st = Request. Form. Set [form1]. tostring ();
String Data2 = Request. Form [txtContent. Text. ToString ()];
String strContent = Data;
String strPath = "E :\\ jin \ CompanyProject \ WebSite \ Web \ txt. Txt"; // such as: D:/Text/File. Txt
File. WriteAllText (strPath, strContent); // save the File
}
Protected void Page_Load (object sender, EventArgs e)
{
If (! IsPostBack)
{
String strPath = "E :\\ jin \ CompanyProject \ WebSite \ Web \ txt. Txt ";
// Read:
TxtContent. Text = File. ReadAllText (strPath );
}
}
Protected void btn_ OK _Click (object sender, EventArgs e)
{
String Data = txtContent. Text;
// String st = Request. Form. Set [form1]. tostring ();
String Data2 = Request. Form [txtContent. Text. ToString ()];
String strContent = Data;
String strPath = "E :\\ jin \ CompanyProject \ WebSite \ Web \ txt. Txt"; // such as: D:/Text/File. Txt
File. WriteAllText (strPath, strContent); // save the File
}
The effect is as follows: