Opened 15 years ago
Closed 15 years ago
#4956 closed Bug (invalid)
IE7 chrashes
Reported by: | pierre.sermain | Owned by: | |
---|---|---|---|
Priority: | Must have (possibly next milestone) | Milestone: | |
Component: | Server : ASP.Net | Version: | FCKeditor 2.6.5 |
Keywords: | Cc: |
Description
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.AppSettingsUseFckEditor?; return !((useFckEditorSetting != null) &&
(String.Compare("false", useFckEditorSetting, true) == 0));
}
protected void Page_Load(object sender, EventArgs e) {
if (IsPostBack) {
RichText.ConfigCustomConfigurationsPath? = ConfigurationManager.AppSettingsFCKeditor:BasePath? + "fckconfig.js?n=" + DateTime.Now.ToString("yyyyMMddhhmmss"); RichText.ForcePasteAsPlainText = true; RichText.HtmlEncodeOutput = false;
if (IsUseFckEditor()) {
Use Text Area TextBox.Attributesstyle? = "display:inline"; RichTextContainer.Attributesstyle? = "display:none";
} else {
TextBox.Attributesstyle? = "display:none"; RichTextContainer.Attributesstyle? = "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> </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
Please use our forums for discussions and community support.