locked
FCKeditor updating a SQL Server table RRS feed

  • Question

  • User-498957627 posted

    Hi All

    I am hoping that someone is able to help me, I am trying to follow the book 'ASP.NET 3.5 Content Management System Development' by Curt Christianson but im having problems with the FCKeditor. I have VS2008  and SQL Server 2005 express, i have installed the FCKeditor which appears on my edit.aspx page but when I hit the update button the page refreshes but does not save any changes to the text back in the database.

    The code for the edit.aspx page is as follows.

    <%@ Page Language="VB" AutoEventWireup="false" CodeFile="edit.aspx.vb" Inherits="edit" %>
    
    <%@ Register Assembly="FredCK.FCKeditorV2" Namespace="FredCK.FCKeditorV2" TagPrefix="FCKeditorV2" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title>Untitled Page</title>
    </head>
    <body>
        <form id="form1" runat="server">
        <div>
            <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:BEWDCMSConnectionString3 %>"
                SelectCommand="SELECT [Content] FROM [Content]" UpdateCommand="UPDATE [Content] SET Content=@Content">
            </asp:SqlDataSource>
            <asp:FormView ID="FormView1" runat="server" DataSourceID ="SqlDataSource1" DefaultMode="Edit">
            <EditItemTemplate>
                    <FCKeditorV2:FCKeditor ID="FCKeditor1" runat="server" Value='<%#Bind("Content") %>'> </FCKeditorV2:FCKeditor>
              </EditItemTemplate>
                </asp:FormView>
                
               
           <asp:LinkButton id="button1" runat="server" commandName="Update" text="Update"/>
        </div>
        </form>
    </body>
    </html>

    If anyone is able to offer any help with this then i would very much appreciate it as ive been stuck on this for some time now and im only page 53 of the book hahah

    Cheers

    Ben

    Monday, January 18, 2010 2:00 PM

All replies

  • User-1161841047 posted

    I used FCKeditor in the past , but when i want to retrieve data to that text, I fill it in code behind.

    try to use DataReader or Dataset for that issue.  

    Monday, January 18, 2010 3:32 PM
  • User-498957627 posted

    can FCKeditor not deal with this itself? It seems quite fundimental stuff for a text editor and  the book seems to think that it should cope with this.

    Monday, January 18, 2010 3:50 PM
  • User595841651 posted

    IS there an error message being thrown of any kind on you? What you have should be fine. I'm wondering if there isn't a permission issue on the DB for the Update? I do know that post-publication there were some updates to FCK that we've run into but I don't think this is one of those...

    (and yeah, I'm one of the authors). 

    Tuesday, January 19, 2010 5:15 PM
  • User-498957627 posted

    Hi Curt

    Who better to help than one of the authors :)

    No, there is no error, when the update button is pressed the edit.aspx page just refreshes but nothing is written back to the database,  The user accounts and DB have been configured as per the book so im a little bit stumped as to why the data is not updating. unless I am seriously missing something.

    cheers

    Ben

    Wednesday, January 20, 2010 3:53 AM
  • User595841651 posted

    The DB setup question was just more of one wondering about the permissions. A number of users have had the folder permissions setup too restrictive and the app would only READ and not insert or update.

    I'll try to recreate the error (or lack of) you mentioned this evening if I can get back to my office. 

    Wednesday, January 20, 2010 8:35 AM
  • User-498957627 posted

     Hi Curt

    I take it you didn't have any luck with this ? I've completely ground to a halt!

    Ben

    Monday, January 25, 2010 2:48 PM
  • User595841651 posted

    Sorry I haven't gotten back to you....haven't been at my pc, only on a work machine and i dont have the ability to load the book code on it.

    The only thing I could think of to try at the moment is change:
    UPDATE [Content] SET Content=@Content

    to:
    UPDATE [Content] SET [Content]=@Content

    Perhaps the Content in this case is a keyword and we had a typo.....

    I'll try to recreate though, but you could skip that section and go on. What you do right there is really throw-away to familiarize yourself with the tools.

    Monday, January 25, 2010 11:59 PM