Wrox Programmer Forums
|
BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6
This is the forum to discuss the Wrox book ASP.NET 2.0 Instant Results by Imar Spaanjaars, Paul Wilton, Shawn Livermore; ISBN: 9780471749516
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 2nd, 2007, 03:01 PM
Registered User
 
Join Date: Jul 2006
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default FCKEditor not working in contentplaceholder

I'm having trouble getting FCKEditor to work in contentplaceholder. The code works fine on a single page, but fails in a master/details configuration. FCKEditor does not show up in the contentplacehodler.

I tested it both in IE 7.0 and FF 2.0.0.11. I downloaded version 2.5 and tried also with the .NET version 2.2. The examples in the Instant Results book(CMS, blog, etc. ) don't work either.

TIA for any hints.

Sample (fails):
<%@ Page Language="VB" MasterPageFile="~/Site.master" ValidateRequest="false" AutoEventWireup="false" Title="Untitled Page" %>
<%@ Register TagPrefix="FCKeditorV2" Namespace="FredCK.FCKeditorV2" Assembly="FredCK.FCKeditorV2" %>

<asp:Content ID="Content2" ContentPlaceHolderID="CPM1" Runat="Server">
    <FCKeditorV2:FCKeditor id="FCKeditor1" BasePath="~/FCKeditor/" runat="server" />
    <br />
    <input id="Submit1" type="submit" value="Submit" runat="server" />
</asp:Content>

 
Old December 2nd, 2007, 07:29 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Can you define "does not show up"? Do you see the HTML for the editor in the final page?

Imar


---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
 
Old December 3rd, 2007, 04:34 AM
Registered User
 
Join Date: Jul 2006
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Imar, thanks for looking at this.
By "don't show up", I mean the control's visibility. It is probably a reference issue. When I plug the HTML code of the single page in the details page the control shows up.
Below are the HTML control snippets corresponding to the single page and the master/details case.

Single Page (ctl shows up):

<div>
      <input type="hidden" id="Hidden1" name="FCKeditor1" value="" />
      <input type="hidden" id="FCKeditor1___Config" value="" />
      <iframe id="FCKeditor1___Frame"
        src="/Anders/FCKeditor/editor/fckeditor.html?InstanceName=FCKeditor1&amp;Toolbar =Default"
        width="100%" height="200px" frameborder="no" scrolling="no">
      </iframe>
  </div>


Details Page (ctl hidden):

<div>
    <input type="hidden" id="ctl00_CPM1_FCKeditor1" name="ctl00$CPM1$FCKeditor1" value="" />
    <input type="hidden" id="ctl00_CPM1_FCKeditor1___Config" value="" />
    <iframe id="ctl00_CPM1_FCKeditor1___Frame"
        src="/Anders/FCKeditor/editor/fckeditor.html?InstanceName=ctl00_CPM1_FCKeditor1& amp;Toolbar=Default"
        width="100%" height="200px" frameborder="no" scrolling="no">
    </iframe>
</div>



 
Old December 3rd, 2007, 02:31 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Very weird. I have identical code in other pages that use a master page as well and everything works fine:

<iframe id="ctl00_MainContentPlaceholder_FCKeditor1___Fram e" src="/FCKeditor/editor/fckeditor.html?
  InstanceName=ctl00_MainContentPlaceholder_FCKedito r1&Toolbar=Default"
  width="100%" height="500px" frameborder="no" scrolling="no">
</iframe>

The only thing different is the ID (my CPH is called MainContentPlaceholder) and the path (I start at FCKeditor in the root).

Have you tried this in a root based site? E.g. where /FCKeditor exists? Or move the FCKeditor folder to the Anders folder? (if it isn't already there).

If that doesn't help, I am lost.... You should probably take this to the FCK Editor forum.

Cheers,

Imar
---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
Want to be my colleague? Then check out this post.
 
Old December 4th, 2007, 04:34 AM
Registered User
 
Join Date: Jul 2006
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Well, by twiddling the html code I found out that the user-control can be made to work if the $ sign is replaced say by an underscore. I guess the $ sign is probably a reserved symbol in FCKEditor. The question was posted on the FCKEditor forum.

Follow-up question: Is there a way to change the name associated to the user-control by ASP.NET either declaratively or by code? Thanks and Regards.

PS: Your "Instant Results" book is a joy to read, concise and easy to follow. Keep up with the good work!

Works (after replacing $ with _ in the first input box name):
        <div>
            <input type="hidden" id="ctl00_CPM1_FCKeditor2" name="ctl00_CPM1_FCKeditor2" value="" />
            <input type="hidden" id="ctl00_CPM1_FCKeditor2___Config" value="" />
            <iframe id="ctl00_CPM1_FCKeditor2___Frame"
                src="/Anders/FCKeditor/editor/fckeditor.html?InstanceName=ctl00_CPM1_FCKeditor2& amp;Toolbar=Default"
                width="100%" height="200px" frameborder="0" scrolling="no">
            </iframe>
        </div>

 
Old December 4th, 2007, 04:43 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

The $ and _ are normally taken care of by .NET. What you see is the output of the ClientID and UniqueID properties of a server side control.

Weird that you need these changes; it has always worked fine for me as you can see from the example I posted (no $ in the name). Do you have a recent version of the FredCK.FCKeditorV2 assembly? Maybe you can get the source, and then manually change the code responsible for outputting the relevant HTML.

Glad to hear you like the book so much.

Cheers,

Imar


---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
 
Old December 4th, 2007, 12:49 PM
Registered User
 
Join Date: Jul 2006
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I decided to dump FCKEditor in favor of TinyMCE. Running TinyMCE within contentplaceholders poses no difficulties.

From what I have read, FCKEditor appears to have some reliability issues. TinyMCE might be an interesting alternative to look at. It is free and provides interesting compression utilities to reduce loading time.

TinyMCE: http://tinymce.moxiecode.com/support/

 
Old December 4th, 2007, 08:38 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

FCK Editor has always worked for me, both in ASP.NET and in other environments.

Then again, switching editor is easy.....good luck with your new editor.

Imar



---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004





Similar Threads
Thread Thread Starter Forum Replies Last Post
ContentPlaceHolder problem snufse ASP.NET 2.0 Basics 1 January 5th, 2008 01:45 AM
ContentPlaceHolder problem nuth ASP.NET 2.0 Basics 1 November 22nd, 2007 01:09 AM
Blog with FCKeditor not working in Firefox cwh BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 5 March 20th, 2007 01:35 AM
Alignment of ContentPlaceHolder garak0410 ASP.NET 2.0 Basics 2 June 7th, 2006 12:06 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.