Welcome Guest Search | Active Topics | Sign In | Register

AjaxUpload script error when hide the control in dialog box Options
Philipp Jenni
Posted: Sunday, September 23, 2007 6:08:49 AM
Rank: Advanced Member
Groups: Member

Joined: 6/9/2007
Posts: 98
Hello,

When i set the property visible = false of a ajaxupload control that is in dialog box, i become an "object required" javascript error with internet explorer 7.0

have you any idee how can i fix this problem?

eo_support
Posted: Sunday, September 23, 2007 6:33:08 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,089
Hi Philipp,

Can you post the .aspx source of the error page and steps to reproduce the error?

Thanks
Philipp Jenni
Posted: Sunday, September 23, 2007 6:52:01 AM
Rank: Advanced Member
Groups: Member

Joined: 6/9/2007
Posts: 98
I have create Dialogbox with the ajaxupload control and 2 buttons (An apply and a cancel button)
The 2 buttons are registered as acceptbutton and as CancelButton. The AcceptButtonPostBack option and the CancelButtonPostBack option are true.

In the PostBack actions i have defined the following code:

Code: Visual Basic.NET
Protected Sub cmdFileUpload_Abort_Click(ByVal sender As Object, ByVal e As System.EventArgs) 
Dim uplFileUpload_Files As EO.Web.AJAXUploader = CType(Me.dialogUpload.ContentContainer.FindControl("uplFileUpload_Files"), EO.Web.AJAXUploader)
uplFileUpload_Files.Visible = False
End Sub


After the frist click on then cancel button (Raise the error), than i can click on the button and the error are not raised.

It has with visible state of the ajaxupload to do.
eo_support
Posted: Sunday, September 23, 2007 7:46:08 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,089
Hi Phillipp,

We tried similar code and it worked fine here. Can you reproduce the same error in a test page and then post complete .aspx and .vb code here?

Thanks
Philipp Jenni
Posted: Sunday, September 23, 2007 8:10:47 AM
Rank: Advanced Member
Groups: Member

Joined: 6/9/2007
Posts: 98
The problem is only when i use the Microsft AJAX Extension...
When i delete the Microsoft AJAX Extension, then it works correctly

Here my Test Page

Code: HTML/ASPX
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Test.aspx.vb" Inherits="Test" Debug="true" %>
<%@ Register Assembly="EO.Web" Namespace="EO.Web" TagPrefix="eo" %>

<!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>My TestPage</title>
    
   
</head>
<body>
    <form id="form1" runat="server">
    <div>
          <asp:ScriptManager ID="MSajaxManager" runat="server">
        </asp:ScriptManager>
        <asp:UpdateProgress ID="MSajaxUpdateProgress" runat="server" AssociatedUpdatePanelID="MSajaxPanel">
            <ProgressTemplate>
                load
            </ProgressTemplate>
        </asp:UpdateProgress>
        <asp:UpdatePanel ID="MSajaxPanel" runat="server">
            <ContentTemplate>
                <asp:Button ID="cmdDialog" runat="server" Text="Dialog On/Off" /><br />
        <eo:Dialog ID="myDialog" runat="server" AllowResize="True" BorderColor="#335C88" BorderStyle="Solid"
            BorderWidth="1px" CloseButtonUrl="00070101" ControlSkinID="None" HeaderHtml="Dialog Title"
            Height="200px" MinimizeButtonUrl="00070102" ResizeImageUrl="00020014" RestoreButtonUrl="00070103"
            ShadowColor="LightGray" ShadowDepth="3" Width="300px" AcceptButton="cmdOk" AcceptButtonPostBack="True" CancelButton="cmdAbort" CancelButtonPostBack="True">
            <HeaderStyleActive CssText="padding-right: 4px; padding-left: 4px; font-size: 11px; background-image: url(00070104); padding-bottom: 3px; padding-top: 3px; font-family: tahoma" />
            <ContentTemplate>
                <eo:AJAXUploader ID="AJAXUpload" runat="server" Width="250px" TempFileLocation="/temp">
                </eo:AJAXUploader>
                <br />
                <br />
                 <asp:Button ID="cmdOk" runat="server" Text="OK" />
                <asp:Button ID="cmdAbort" runat="server" Text="Abort" OnClick="cmdAbort_Click" /><br />
            </ContentTemplate>
            <ContentStyleActive CssText="border-top: #335c88 1px solid; background-color: #e5f1fd" />
            <FooterStyleActive CssText="background-color: #e5f1fd; padding-bottom: 8px;" />
        </eo:Dialog>
            </ContentTemplate>
        </asp:UpdatePanel>
    </div>
    </form>
</body>
</html>


and here my Code file


Code: Visual Basic.NET
Partial Class Test
    Inherits System.Web.UI.Page

    Protected Sub cmdAbort_Click(ByVal sender As Object, ByVal e As System.EventArgs)
        Dim AJAXUpload As EO.Web.AJAXUploader = CType(Me.myDialog.ContentContainer.FindControl("AJAXUpload"), EO.Web.AJAXUploader)
        AJAXUpload.Visible = False
    End Sub

    Protected Sub cmdDialog_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles cmdDialog.Click
        Me.myDialog.InitialState = EO.Web.DialogState.Visible
    End Sub
End Class
eo_support
Posted: Sunday, September 23, 2007 8:21:02 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,089
Thanks buddy. That puts us on the right track. We now see the error. Will get back to you as soon as we find anything.
eo_support
Posted: Sunday, September 23, 2007 9:32:12 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,089
Hi,

We looked into the issue and noticed that the problem is caused by our controls are not being fully unloaded by ASP.NET AJAX when it performs an partial page update. We are looking into it and see how we can get our controls fully unloaded and the issue should be addressed in our next build.

In the mean time, the easiest workaround for you would be using our CallbackPanel instead of ASP.NET's AJAX UpdatePanel. Our CallbackPanel works pretty much the same as ASP.NET AJAX UpdatePanel and does not have this problem. In order to use our CallbackPanel, you would need to:

1. Replace asp:UpdatePanel with eo:CallbackPanel;
2. Remove <ContentTemplate>. Our CallbackPanel does not use a separate <ContentTemplate> tag to holds the content. It works similar to a regular ASP.NET Panel control and holds the contents directly inside its open and close tags;
3. Edit the CallbackPanel's Trigger property to include both cmdDialog and myDialog. Our CallbackPanel does not automatically treat child controls as triggers, so you want to explicitly set it;

That should get you going. Please let us know if you see anything else.

Thanks


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.