Hi,
I'm using Cute Editor 6.4 and encountered a bug with cuteeditor resetting my focus because of it's loading. This only happens in IE 6.
Basically I initially set focus on an input field on the main page. After I click a button to open a modal popup I set the focus to another input field on the popup. However, after Cute Editor finishes loading the focus gets set back to the field on the main page.
The focus setting works completely fine if I'm don't have a Cute Editor in the modal popup or if I'm not using an update panel for asynchronous postback.
Below is an example page that can reproduce the bug.
- <%@ Page Language="vb" AutoEventWireup="false" %>
-
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
- <%@ Register TagPrefix="CE" Namespace="CuteEditor" Assembly="CuteEditor" %>
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head runat="server">
-
- <script type="text/VB" runat="server">
- Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
- Page.SetFocus(txtMain)
- End Sub
-
- Private Sub btnShow_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnShow.Click
- modalExtender.Show()
- Page.SetFocus(txtName)
- End Sub
- </script>
-
- <style type="text/css">
- /*Modal Popup*/.modalBackground
- {
- background-color: Gray;
- filter: alpha(opacity=70);
- opacity: 0.7;
- }
- .modalBox
- {
- width: 700px;
- text-align: center;
- background-color: #ffffff;
- padding: 1px 0px;
- }
- </style>
- <title></title>
- </head>
- <body>
- <form id="form1" runat="server">
- <cc1:ToolkitScriptManager ID="scriptMgr" runat="server" CombineScripts="true">
- </cc1:ToolkitScriptManager>
- <asp:UpdatePanel ID="updMain" runat="server" UpdateMode="Conditional">
- <ContentTemplate>
- <div>
- <asp:TextBox ID="txtMain" runat="server"></asp:TextBox>
- <asp:Button ID="btnShow" runat="server" Text="Show popup" />
- </div>
- <asp:Panel ID="pnlPopup" runat="server" Style="display: none;" meta:resourcekey="pnlPopupResource1"
- CssClass="modalBox">
- <table style="width: 80%;">
- <tr>
- <td>
- <asp:Label ID="lblName" runat="server" AssociatedControlID="txtName" Text="Name:"
- meta:resourcekey="lblNameResource" />
- </td>
- <td>
- <asp:TextBox ID="txtName" runat="server" MaxLength="100" Style="width: 450px;" />
- </td>
- </tr>
- <tr>
- <td>
- <asp:Label ID="lblInquiry" runat="server" AssociatedControlID="ceInquiry" Text="Message:"
- meta:resourcekey="lblInquiryResource" />
- </td>
- <td>
- <CE:Editor Width="455" Height="250" ID="ceInquiry" EditorOnPaste="PasteWord" AutoConfigure="Simple"
- runat="server" ShowBottomBar="true" MaxHTMLLength="4000" ShowWordCount="true"
- ShowHtmlMode="true" ShowPreviewMode="false" ShowTagSelector="false" Focus="false">
- </CE:Editor>
- </td>
- </tr>
- <tr>
- <td style="text-align: right;" colspan="2">
- <asp:Button ID="btnCancel" runat="server" CausesValidation="False" Style="width: auto;"
- Text="Cancel" />
- </td>
- </tr>
- </table>
- </asp:Panel>
- <asp:Button ID="btnDummy" runat="server" Style="display: none;" meta:resourcekey="btnDummyResource1" />
- <cc1:ModalPopupExtender ID="modalExtender" runat="server" TargetControlID="btnDummy"
- PopupControlID="pnlPopup" BackgroundCssClass="modalBackground" DynamicServicePath=""
- Enabled="True" />
- </ContentTemplate>
- </asp:UpdatePanel>
- </form>
- </body>
- </html>
Thanks in advance