﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
4956	IE7 chrashes	pierre.sermain		"I have implemented multiple FCKEditor in a page using a .NET control (ascx page) but when the postback occurs, IE7 crashes. I do not have the issue on Firefox but my company only use IE7 so I have to make it work on IE7.

I have the ValidateRequest set to ""False"" in my page:

<%@ Page Language=""C#"" AutoEventWireup=""true"" CodeBehind=""BestPracticesInActionSubmit_Step1.aspx.cs"" Inherits=""PSAMV3.Modules.PRBestPracticesInAction.BestPracticesInActionSubmit_Step1"" ValidateRequest=""false""%>

I declare a Rich Text Area control page:
<%@ Register TagPrefix=""uc4"" TagName=""RichTextArea"" Src=""RichTextArea.ascx"" %>

And here is the code of the control page:
''<%@ Control Language=""C#"" AutoEventWireup=""true"" CodeBehind=""RichTextArea.ascx.cs"" Inherits=""PSAMV3.Modules.PRBestPracticesInAction.RichTextArea"" %>
<%@ Register TagPrefix=""FCKeditorV2"" Namespace=""FredCK.FCKeditorV2"" Assembly=""FredCK.FCKeditorV2"" %>
<asp:textbox id=""TextBox"" Cols=""52"" Rows=""15"" TextMode=""MultiLine"" runat=""server"" Width=""500"" Height=""200""></asp:textbox>
<div id=""RichTextContainer"" runat=""server"">
    <FCKeditorV2:FCKeditor id=""RichText"" runat=""server"" height=""200"" ToolbarSet=""PsamToolBar""></FCKeditorV2:FCKeditor>
</div>
<script>

function GetValue<%=ClientID%>(){

	<%	if (IsUseFckEditor())
		{
	%>
			try{
				if(FCKeditorAPI && FCKeditorAPI.GetInstance('<%=RichText.ClientID%>')){
					
						return FCKeditorAPI.GetInstance('<%=RichText.ClientID%>').GetHTML();
						return FCKeditorAPI.GesI

				}else{
					return $('#<%=TextBox.ClientID%>').val();
				}
			}catch(err){
				return $('#<%=TextBox.ClientID%>').val();
			}
		
	<%	}else
		{
	%>
			return $('#<%=TextBox.ClientID%>').val();
	<%	}
	%>
	
}

function updateEditorField<%=ClientID%>() {  
 	<%	if (IsUseFckEditor())
		{
	%>
			FCKeditorAPI.GetInstance('<%=RichText.ClientID%>').UpdateLinkedField();
			$('#<%=TextBox.ClientID%>').val(FCKeditorAPI.GetInstance('<%=RichText.ClientID%>').GetHTML());
	<%	}
	%>
}
</script>''




This is the cs code for the control:
using System;
using System.Configuration;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;

namespace PSAMV3.Modules.PRBestPracticesInAction
{
    public partial class RichTextArea : System.Web.UI.UserControl
    {
        protected bool IsUseFckEditor()
        {
            string useFckEditorSetting = ConfigurationManager.AppSettings[""UseFckEditor""];
            return !((useFckEditorSetting != null) &&
                    (String.Compare(""false"", useFckEditorSetting, true) == 0));
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                
                RichText.Config[""CustomConfigurationsPath""] = ConfigurationManager.AppSettings[""FCKeditor:BasePath""] + ""fckconfig.js?n="" + DateTime.Now.ToString(""yyyyMMddhhmmss"");
                RichText.ForcePasteAsPlainText = true;
                RichText.HtmlEncodeOutput = false;

                if (!IsUseFckEditor())
                {
                    //	Use Text Area
                    //
                    TextBox.Attributes[""style""] = ""display:inline"";
                    RichTextContainer.Attributes[""style""] = ""display:none"";
                }
                else
                {
                    TextBox.Attributes[""style""] = ""display:none"";
                    RichTextContainer.Attributes[""style""] = ""display:inline"";
                }
            }
        }

        //----
        // Property
        //----
        public string Text
        {
            get
            {
                if (!IsUseFckEditor())
                {
                    return TextBox.Text;
                }
                else
                {
                    return RichText.Value;
                }
            }

            set
            {
                if (!IsUseFckEditor())
                {
                    TextBox.Text = value;
                }
                else
                {
                    //TextBox.Text = value;
                    RichText.Value = value;
                }
            }
        }
    }
}


and this is the part of the page where I call my control:
<tr>
								<td class=""contenuGras"">
									<div id=""uniquenessDiv"">
										<table width=""100%"">
											<tr>
												<td width=""120""><a class=""ToggleElement"" id=""uniqueness"" href=""#"" detailElementId=""uniquenessDetailDiv""
														elementId=""uniquenessDiv"">Uniqueness </a>
												</td>
											</tr>
											<tr>
												<td>
													<div class=""resumeDetailElement"" id=""uniquenessDetail"">
														<table width=""100%"">
															<tr>
																<td><span style=""width=100%;"" class=""populatedValue"" id=""uniquenessDetailValue""></span></td>
																<td width=""30"">
																</td>
																<td width=""75""><a onclick=""return clickOnToggleElement('uniqueness');"" href=""#""><img src=""pt://images/plumtree/portal/private/psam/images/methods/pa/bt_modify.gif"" border=""0"">
																	</a>
																</td>
															</tr>
														</table>
													</div>
												</td>
											</tr>
										</table>
									</div>
									<div class=""detailElement"" id=""uniquenessDetailDiv"">
										<table width=""100%"">
											<tr>
												<td><span class=""ToggleElementOpened"">Uniqueness</span>
												</td>
											</tr>
											<tr>
												<td>
													<uc4:RichTextArea id=""UniquenessRichTextArea"" runat=""server""></uc4:RichTextArea>
												</td>
											</tr>
											<tr>
												<td>&nbsp;</td>
												<td><a onclick=""return clickOnOk('uniquenessDetailValue','uniqueness',GetValue<%= UniquenessRichTextArea.ClientID%>(),'uniquenessDetail')""
														href=""#""><img src=""pt://images/plumtree/portal/private/psam/images/methods/pa/bt_ok.gif"" border=""0""></a></td>
											</tr>
										</table>
									</div>
								</td>
							</tr>


If someone could help me that would be great!

Pierre"	Bug	closed	Must have (possibly next milestone)		Server : ASP.Net	FCKeditor 2.6.5	invalid		
