PDA

View Full Version : [FIXED] HTML Editor inside an update panel?



Julian
Feb 29, 2008, 8:16 PM
Hello guys,
I was playing with the coolite controls today and really enjoyed it. However, just found a strange behavious of the HtmlEditor placed on an update panel.

Please try the following code:


<%@ Page Language="C#" AutoEventWireup="true" CodeFile="test.aspx.cs" Inherits="Admin_test" %>
<%@ Register assembly="Coolite.Web.UI" namespace="Coolite.Web.UI" tagprefix="cool" %>
<!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>HTML Editor Test</title>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager2" runat="server">
</asp:ScriptManager>
<cool:ScriptManager ID="ScriptManager1" runat="server" />

<asp:Button ID="Button1" runat="server" Text="Update HTML Editor"
&#111;nclick="Button1_Click" />


<div style="border:2px solid #c90000; padding:20px; margin:20px;">
<asp:UpdatePanel ID="UpdatePanel1" runat="server" ChildrenAsTriggers="False" UpdateMode="Conditional">
<ContentTemplate>
<cool:HtmlEditor ID="HtmlEditor1" runat="server" />
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="Button1" EventName="Click" />
</Triggers>
</asp:UpdatePanel>



<asp:Button ID="Button2" runat="server" Text="Update the 2nd panel"
&#111;nclick="Button2_Click" />


<div style="border:2px solid #c90000; padding:20px; margin:20px;">
<asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:Label ID="Label1" runat="server"></asp:Label>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="Button2" EventName="Click" />
</Triggers>
</asp:UpdatePanel>


</form>
</body>
</html>

And the code behind is quite simple:


public partial class Admin_test : System.Web.UI.Page
{
protected void Button1_Click(object sender, EventArgs e)
{
HtmlEditor1.Text += "Updated! ";
}
protected void Button2_Click(object sender, EventArgs e)
{
Label1.Text += "Label updated! ";
}
}

When you click on Button1, the HtmlEditor is bein updated as expected. However, when you click on Buttton2, it seems that another instance on the HtmlEditor is being created inside UpdatePanel1. And that is for every Button2 click. Weird...

Or, I'm doing something wrong?

Regards,
Julian

geoffrey.mcgill
Feb 29, 2008, 9:21 PM
Hi Julian,

Thanks for the sample. I'll test this out and let you know what's going wrong. We're expecting to release version 0.4 on Tuesday, so if a fix is necessary, I'll do my best to squeeze it into 0.4.

geoffrey.mcgill
Mar 15, 2008, 12:01 AM
I apologize for the delay in getting back to you regarding this issue.

I have reproduced the bug, but do not have a fix (yet). I have an idea why this is happening, although a solution is going to involve some re-plumbing inside the Assembly. I will do my best to keep this thread updated with our progress.

geoffrey.mcgill
Jun 15, 2008, 11:41 AM
This bug has been fixed with the latest release. Please download from the following location.

http://www.ext.net/download/

Hope this helps.