Welcome Guest Search | Active Topics | Sign In | Register

UpdatePanel and DatePicker - getting 'htmlfile: Invalid argument.' error Options
patingamon
Posted: Friday, December 11, 2009 12:57:00 PM
Rank: Member
Groups: Member

Joined: 9/6/2007
Posts: 29
I recently updated my calendar control to be the eo:DatePicker. Unfortunately I get the error: 'htmlfile: Invalid argument.' when doing this internal operation

Code: JavaScript
this.acx=a.createStyleSheet()


I have read that this is due to it being inside an UpdatePanel AND that I need to have the eo:ScriptManager

I am not sure about the syntax but this is what I have in the Master Page

Code: HTML/ASPX
<ajax:ToolkitScriptManager ID="StaffingScriptManager" runat="server" 
            EnableViewState="false"
            EnablePartialRendering="true"
            CombineScripts="true" 
            AllowCustomErrorsRedirect="true"
            LoadScriptsBeforeUI="true" >
        </ajax:ToolkitScriptManager>
	<eo:ScriptManager runat="server" ID="_eoScriptManager">
	</eo:ScriptManager>


The problem still occurs, so I am assuming I am doing something wrong. I have tried reversing the order but to no avail.

I am currently using version 6.0.63.2

Any thoughts?
eo_support
Posted: Friday, December 11, 2009 1:34:20 PM
Rank: Administration
Groups: Administration

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

Can you post a complete test page? Please make sure the test page only includes what's necessary to reproduce the problem and runs independently. Once we have that we will run it here and see what we can find. Also make sure you run on the latest version as well.

Thanks!
patingamon
Posted: Tuesday, December 15, 2009 11:05:34 AM
Rank: Member
Groups: Member

Joined: 9/6/2007
Posts: 29
Code: HTML/ASPX
<%@ Page Language="C#" AutoEventWireup="true" Inherits="Test.TestDatePicker" %>

<!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 id="Head1" runat="server">
    <title> Test DatePicker</title>
    <meta http-equiv="Pragma" content="no-cache" />
    <meta http-equiv="Expires" content="-1" />
    
    <script type="text/javascript" >
        function pageLoad(args)
        {
            var dateObject = eo_GetObject('_test');
            if (dateObject == null)
            {
                alert("eo_GetObject('_test') failed"); 
            }
        }
    </script>
</head>
<body>
    <form id="Form1" runat="server">

        <asp:ScriptManager ID="_StaffingScriptManager" runat="server" 
            EnableViewState="false"
            EnablePartialRendering="true"
            AllowCustomErrorsRedirect="true"
            LoadScriptsBeforeUI="true" >
        </asp:ScriptManager>

	    <eo:ScriptManager runat="server" ID="_eoScriptManager">
	    </eo:ScriptManager>

        <div>
        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <ContentTemplate>
                <eo:DatePicker runat="server" ID="_test"></eo:DatePicker>
                <asp:Button runat="server" ID="_submit" UseSubmitBehavior="true" Text="Submit" />
            </ContentTemplate>    
        </asp:UpdatePanel>
        </div>
        
    </form> 
</body>


As mentioned before, I am on
I am currently using version 6.0.63.2. Is there a later version that corrects this issue?

Cheers,
Dave
patingamon
Posted: Tuesday, December 15, 2009 11:07:32 AM
Rank: Member
Groups: Member

Joined: 9/6/2007
Posts: 29
Forgot to mention that when the screen is loaded (and pageLoad is called) no alert is shown. However, as soon as the submit button is pressed and the pageLoad is called the alert is shown.
patingamon
Posted: Thursday, December 17, 2009 12:20:40 PM
Rank: Member
Groups: Member

Joined: 9/6/2007
Posts: 29
Has there been any progress on this?
eo_support
Posted: Thursday, December 17, 2009 12:36:57 PM
Rank: Administration
Groups: Administration

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

Sorry about the delay. The behavior demonstrated in your sample is normal. The DatePicker is created by JavaScript, because AJAX UpdatePanel (and our CallbackPanel) applying the new DHTML and executing JavaScript separately (unlike the initial load that is handled by the browser directly, which load both sequentially as they appear). So the DatePicker is always created later when it recreated during AJAX call. If you wish to execute some code after the DatePicker is loaded, you can either handle the DatePicker's ClientSideOnLoad event handler or delay the call with setTimeout.

I do not know how the test page is related to your original question though. So if you wish us to investigate the original problem, we still a test page for that.

Thanks!
patingamon
Posted: Friday, December 18, 2009 8:23:14 AM
Rank: Member
Groups: Member

Joined: 9/6/2007
Posts: 29
Your response was what I needed to know in order to debug the rest of the problem. I couldn't recreate the problem a simple example until I got past this issue. I chose to use the timer approach as there may be multiple eo controls and all would need to be loaded. It is disappointing that they are not loaded at pageLoad time, as that simplifies things.

So, after applying your suggestion all of my pages worked except one - the original one that had the "htmlfile: Invalid argument." issue. After hours of trying multiple things I finally found the issue. A previous developer had placed inside the content portion of the child page these lines:

Code: HTML/ASPX
<asp:Content ID="Content1" ContentPlaceHolderID="SchedulingReportContentHolder" runat="server" >

    <style>
	    .hidden { DISPLAY: none }
    </style>


ends up the <style> lines were the culprits. Once I removed them the problem went away. Odd that it was an eo error that was occurring, but eo must parse or eval the page.

Hopefully this tip to avoid <style> inside a child page will benefit other developers.

Thanks for your help.
eo_support
Posted: Friday, December 18, 2009 9:14:14 AM
Rank: Administration
Groups: Administration

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

Glad that it works for you. Our code does not parse the page, but we do create styles. So maybe somehow that would conflict with the style element you have. Thank you very much for sharing!

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.