<html>
<head>
<title>FCKeditor - Sample</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<form runat="server">
<asp:Label ID="lblContents" runat="server" />
<br />
<FCKeditorV2:FCKeditor id="FCKeditor1" BasePath="/FCKeditor/" Width="400px" ToolbarSet="Basic" runat="server"></FCKeditorV2:FCKeditor>
<br>
<input type="submit" value="Submit" runat="server">
</form>
<div style="font-family: verdana; font-size: 76%">
<%
dim strContents
strContents=Request.Form("FCKeditor1")
If strContents<>"" Then
Response.Write("<p>" & strContents & "</p>")
End If
%>
</div>
</body>
</html>
Mon, 07/24/2006 - 06:49
#1

RE: VB.NET problem retrieving data from FCKed
At last I got some VB.NET code to work - it loads a file which you can edit with FCKeditor, then it will save the file by overwriting the original.
As promised, here's the code, but I would appreciate any comments to make it better .....
<%@ Page ValidateRequest="false" Language="VB" %>
<%@ Import Namespace="System.IO" %>
<%@ Register TagPrefix="FCKeditorV2" Namespace="FredCK.FCKeditorV2" Assembly="FredCK.FCKeditorV2" %>
<script runat="server" language="VB">
Sub Page_Load(s As Object, e As EventArgs)
If Not IsPostBack Then
Dim objStreamReader As StreamReader
Dim strInput As String
Dim strSeedData As String
strSeedData = ""
objStreamReader = File.OpenText(MapPath("cgi-bin\story.txt"))
strInput = objStreamReader.ReadLine()
While (strInput <> Nothing)
strSeedData &= strInput
strInput = objStreamReader.ReadLine()
End While
objStreamReader.Close()
FCKeditor1.Value = strSeedData
End If
End Sub
Sub SaveStory(s As Object, e As EventArgs)
Dim strData2Save As String = FCKeditor1.Value.ToString
Dim objStreamWriter As StreamWriter
objStreamWriter = File.CreateText( MapPath("cgi-bin\story.txt"))
objStreamWriter.WriteLine(strData2Save)
objStreamWriter.Close
End Sub
</script>
Thanks to this forum and the documentation, I finally got there !!
I hope this helps others. FCKeditor - or whatever you finally call it - is a great alternative to the commercial products.
Regards,
Keen2Try