I'm using a formView control in ASP.NET 2.0 to populate a record in a SQL Server 2005 database. I want to use FCKeditor to fill one of the fields. Has anyone done this?
I have never used ASP.NET's FormView control before other than to take a brief look at it a few moments ago by dropping it onto a web page. From what I see, it automatically generates all labels, textboxes and additional controls for viewing/editing/adding records based on a table or SQL statement and it also looks as if it handles all the data binding, too; is this correct? If so, I don't see any problems using FCKeditor to also view/edit/add data to a field in SQL Server or any other database. The only thing you might have to do differently is write some functions to handle the data binding ... one to populate the textarea with any data that may already exist in the field and another one to take the contents of the textarea and write them to SQL Server. Neither of these is particularly difficult.
Rather than using a FormView control in our app, I've laid out all the controls, including FCKeditor, on my page and have written code to handle all the data binding routines. I'm using FCKeditor to allow our users to create/edit/review templates for use with form letters. I've given it an ID of FCKeditor1 on the page ... when I'm ready to save anything in it, I set a string variable equal to FCKeditor1.Value and then store that string variable in a varchar(MAX) field in the SQL Server table. To display any information that may already be in the varchar(MAX) field, I read that data into a string variable and then set FCKeditor1.Value equal to the string variable. I imagine the use of the string variable could be done away with in your case, but I need it for additional reasons beyond simply editing it.
Re: Using in .net in a formview
Rather than using a FormView control in our app, I've laid out all the controls, including FCKeditor, on my page and have written code to handle all the data binding routines. I'm using FCKeditor to allow our users to create/edit/review templates for use with form letters. I've given it an ID of FCKeditor1 on the page ... when I'm ready to save anything in it, I set a string variable equal to FCKeditor1.Value and then store that string variable in a varchar(MAX) field in the SQL Server table. To display any information that may already be in the varchar(MAX) field, I read that data into a string variable and then set FCKeditor1.Value equal to the string variable. I imagine the use of the string variable could be done away with in your case, but I need it for additional reasons beyond simply editing it.
HTH,
Allen Anderson