1

Topic: Bug using asp.net Ajax UpdatePanel or TabContainer

Hi,
It seems there's a bug with the UpdatePanel (I get a javascript error)
I add a TabContainer with an UpdatePanel that is not wrapping the Tinymce control.

Here's a minimal code where you can see the error.
To get the error, just add some content on the tinymce control, click on the link "Test", goto the Item container, and click on the "Test" button.

Do you have any idea how to fix this problem ?
Stan

here's the code.



<%@ Page Language="C#" AutoEventWireup="true" CodeFile="test.aspx.cs" Inherits="test" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<%@ Register TagPrefix="tinymce" Namespace="Moxiecode.TinyMCE.Web" Assembly="Moxiecode.TinyMCE" %>
<!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></title>

    <script src="js/tiny_mce/tiny_mce_src.js" type="text/javascript"></script>

</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:ScriptManager ID="SM" runat="server" />
        <cc1:TabContainer ID="TabNews" runat="server">
            <cc1:TabPanel ID="TabComposition" HeaderText="Item" runat="server">
                <ContentTemplate>
                    <asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Conditional">
                        <ContentTemplate>
                            <asp:TextBox ID="nom" runat="server"></asp:TextBox>
                            <asp:Button ID="btn" Text="test" runat="server" />
                        </ContentTemplate>
                    </asp:UpdatePanel>
                </ContentTemplate>
            </cc1:TabPanel>
            <cc1:TabPanel ID="TabCategories" runat="server" HeaderText="Tiny">
                <ContentTemplate>
                    <table style="width: 100%;">
                        <tr>
                            <td colspan="3" style="width: 100%; border: 1px solid #fabd37; padding: 10px;">
                                Titre<br />
                                <strong>
                                    <asp:Label ID="etitre" runat="server" /></strong>
                            </td>
                        </tr>
                    </table>
                    <div style="float: left; text-align: center; width: 100%; margin: 10px 0">
                        <tinymce:TextArea ID="elm1" theme="advanced" InstallPath="js/tiny_mce/" plugins="safari,style,table,advhr,advimage,advlink,inlinepopups,media,searchreplace,contextmenu,paste,noneditable,visualchars,nonbreaking,xhtmlxtras,template, imagemanager "
                            theme_advanced_buttons1="bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect,fontselect,fontsizeselect"
                            theme_advanced_buttons2="cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,code,|,forecolor,backcolor"
                            theme_advanced_buttons3="tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,media,advhr,"
                            theme_advanced_toolbar_location="top" theme_advanced_toolbar_align="left" theme_advanced_path_location="bottom"
                            Width="800" Height="400" runat="server" />
                    </div>
                    <p style="text-align: right;">
                        <a href="#" onclick="alert('test')">Test</a>
                    </p>
                </ContentTemplate>
            </cc1:TabPanel>
        </cc1:TabContainer>
    </div>
    </form>
</body>
</html>

2

Re: Bug using asp.net Ajax UpdatePanel or TabContainer

Not sure...but I use ACT TabContainer (without UpdatePanel though) and TinyMCE seems to work fine (except for the spellcheck which timesout - but only on IIS, not when using VS development server).

One thing, I don't use the <script src="js/tiny_mce/tiny_mce_src.js" type="text/javascript"></script> at all?! Just using <tinymce:TextArea> seems to be enough for me? Any special reason to use <script> aswell?!?

3

Re: Bug using asp.net Ajax UpdatePanel or TabContainer

ok, in fact if I add ValidateRequest="false"  it works.
I don't know if it's the best way..

4

Re: Bug using asp.net Ajax UpdatePanel or TabContainer

I think ValidateRequest="false" needs to be set because if it's not postbacks that contains <tagged> data won't work...It's a security feature of IIS to dissallow potentially malicious code being injected....Glad to hear all works fine for you...Have you maybe tried using the spellchecker plugin?

Last edited by nubie (2008-08-14 13:08:34)

5

Re: Bug using asp.net Ajax UpdatePanel or TabContainer

No I don't use for now the spellchecker. If I will (not in my plan) I will you inform you.
Thanks