Hey Everyone,
I just joined CKEditor and am trying to implement the new CKEditor the way I implemented the FCKeditor in my asp.net pages. Here is my code behind and I am now getting this error: Compiler Error Message: BC30456: 'Value' is not a member of 'CKEditor.NET.CKEditorControl'. Can someone help me resolve this?
Imports system.data.sqlclient
Imports System.Web.UI.WebControls
Partial Class _Default
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim CKEditor1 As New CKEditor.NET.CKEditorControl
If (Request.IsAuthenticated = False) Then
Response.Redirect("/admin")
Else
If Not IsPostBack Then
Get_Content()
End If
End If
End Sub
Protected Sub Get_Content()
Dim cmd_GetContent As New SqlCommand("sp_GetPageContent", New SqlConnection("Server=; User ID=; Password=; Trusted_Connection=False"))
With cmd_GetContent
.CommandType = Data.CommandType.StoredProcedure
.Parameters.Add(New SqlParameter("@PageName", "home"))
Try
.Connection.Open()
CKEditor1.Value = cmd_GetContent.ExecuteScalar
.Connection.Close()
Catch ex As Exception
Response.Write("error" & ex.ToString)
End Try
End With
End Sub
Protected Sub Submit1_ServerClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles Submit1.ServerClick
Dim cmd_SetContent As New SqlCommand("sp_SetPageContent", New SqlConnection("Server=; Database=; User ID=; Password=; Trusted_Connection=False"))
With cmd_SetContent
.CommandType = Data.CommandType.StoredProcedure
.Parameters.Add(New SqlParameter("@PageName", "home"))
.Parameters.Add(New SqlParameter("@PageContent", CKEditor1.Value))
Try
.Connection.Open()
cmd_SetContent.ExecuteNonQuery()
.Connection.Close()
Catch ex As Exception
Response.Write("error" & ex.ToString)
End Try
End With
End Sub
End Class
Replace .Value with .Text
This one was easy. I just went through the same thing!
All instead of using .value in your VB code, use .text
On line 47...
.Parameters.Add(New SqlParameter("@PageContent", CKEditor1.Value))
Should be changed to
.Parameters.Add(New SqlParameter("@PageContent", CKEditor1.text))