Click here to Skip to main content
13,768,153 members
Rate this:
 
Please Sign up or sign in to vote.
See more:
I am getting the following error:
Microsoft JScript runtime error: Sys.ArgumentNullException: Value cannot be null.
Parameter name: panelsCreated[1]
while pointing to the following code in file(ScriptResource.axd...[dynamic]):
$type.registerClass('Sys.WebForms.InitializeRequestEventArgs', Sys.CancelEventArgs);
$type = Sys.WebForms.PageLoadedEventArgs = function PageLoadedEventArgs(panelsUpdated, panelsCreated, dataItems) {
    /// <summary locid="M:J#Sys.WebForms.PageLoadedEventArgs.#ctor">The arguments for the PageRequestManager's pageLoaded event. The pageLoaded event is raised after the DOM has been updated.</summary>
    /// <param name="panelsUpdated" type="Array">An array of UpdatePanels that were updated.</param>
    /// <param name="panelsCreated" type="Array">An array of UpdatePanels that were created.</param>
    /// <param name="dataItems" type="Object" mayBeNull="true"></param>
    var e = Function._validateParams(arguments, [
        {name: "panelsUpdated", type: Array},
        {name: "panelsCreated", type: Array},
        {name: "dataItems", type: Object, mayBeNull: true}
    ]);
    if (e) throw e;
    Sys.WebForms.PageLoadedEventArgs.initializeBase(this);

    this._panelsUpdated = panelsUpdated;
    this._panelsCreated = panelsCreated;
    this._dataItems = dataItems || new Object();
}

with line : " if (e) throw e" highlighted.

This is happening when I click for the 2nd or 3rd time in a row on a LinkButton.
The LinkButton successfully calls/executes a WebService method, and then produces the error!

The LinkButton code is below:
<asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
</asp:ToolkitScriptManager>
<asp:Panel ID="Panel3" runat="server">
    <asp:UpdatePanel ID="UpdatePanel3" runat="server" UpdateMode="Conditional">
        <ContentTemplate>
 <asp:LinkButton ID="LinkButton100" CssClass="calendar" 

        value="LinkButton1" rel="nofollow" runat="server" 

        OnClick="LinkButton1_Click">hi</asp:LinkButton>
 <asp:LinkButton ID="LinkButton60" CssClass="calendar" 

        value="LinkButton60" runat="server" OnClick="LinkButton1_Click">LinkButton
  </asp:LinkButton><br />
  <asp:LinkButton ID="LinkButton120" CssClass="calendar" 

        value="LinkButton120" runat="server"OnClick="LinkButton1_Click">LinkButton12
</asp:LinkButton>
<asp:Panel ID="Panel1" CssClass="popup" runat="server">
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="False">
    <ContentTemplate>
         <div>
             Event:
             <asp:Literal ID="Literal1" runat="server"></asp:Literal><br />
             Time:
             <asp:Literal ID="Literal2" runat="server"></asp:Literal><br />
             Location:
             <asp:Literal ID="Literal3" runat="server"></asp:Literal><br />
      </div>
 </ContentTemplate>
   <Triggers>
        <asp:AsyncPostBackTrigger ControlID="LinkButton60" EventName="Click" />
         <asp:AsyncPostBackTrigger ControlID="LinkButton120" EventName="Click" />
 </Triggers>
</asp:UpdatePanel>
 </asp:Panel>
 <asp:BalloonPopupExtender ID="BalloonPopupExtender1" BalloonPopupControlID="Panel1"Position="TopRight" 

     TargetControlID="LinkButton60" runat="server" 

     BalloonSize="Medium"DisplayOnMouseOver="True" 

     DynamicContextKey='1' DynamicControlID="Panel1"

     DynamicServicePath="DynamicPopulate.asmx" 

     DynamicServiceMethod="UpdatePanel1_DynamicPopulateExtender">
</asp:BalloonPopupExtender>
<asp:Panel ID="Panel2" runat="server" 

    CssClass="popup">
<asp:UpdatePanel ID="UpdatePanel2" runat="server" 

     UpdateMode='Conditional' ChildrenAsTriggers="false">
   <ContentTemplate>
           <asp:PlaceHolder ID="PlaceHolder1" 

               runat="server">
                 <asp:Image ID="Image1" Style="height: auto;"

                     ImageUrl="/img/imagename.jpg" 

                     AlternateText="nameofevent"

                     />
            </asp:PlaceHolder>
    </ContentTemplate>
    <Triggers>
           <asp:AsyncPostBackTrigger ControlID="LinkButton60" 

                EventName="Click"  />
               <asp:AsyncPostBackTrigger ControlID="LinkButton120" 

                    EventName="Click" />
     </Triggers>
</asp:UpdatePanel>
</asp:Panel>
<asp:PopupControlExtender ID="PopupControlExtender1"

        runat="server" Position="Bottom" 

        PopupControlID="Panel2" DynamicContextKey="value" 

        DynamicControlID="Panel2" 

        DynamicServiceMethod="PlaceHolder1_DynamicPopulateExtender"

        DynamicServicePath="DynamicPopulate.asmx"

        TargetControlID="LinkButton60">
</asp:PopupControlExtender>
        </ContentTemplate>
    </asp:UpdatePanel>

The web service method:
       [System.Web.Services.WebMethodAttribute(),
        System.Web.Script.Services.ScriptMethodAttribute()]
       public string PlaceHolder1_DynamicPopulateExtender(string contextKey)
       {
.............builds a string, s
           return s.ToString();
       }

ANY IDEAS what the problem is? or how can find it???
Posted 3-Dec-12 23:33pm
v2
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

Set ScriptMode="Release" of your ScriptManager.
  Permalink  
Comments
ken.wyatt 12-Jul-13 9:42am
   
That fixes the issue, but do you know why it's an issue in the first place?
vinayppn 16-Sep-13 8:55am
   
Thank you very much for the solution Saboor.
roopa1984 24-Feb-14 5:13am
   
Thank you very much..this is exactly what am looking for..it works!!!! :)
BD Innovative 10-Mar-14 12:03pm
   
nice bro
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 4

Setting ScriptMode="Release" is kind of hacking at the leaves instead of the roots. I think "Release" mode is the same for building a project in release mode. i.e. don't give away any debug info. So in essence all you're doing by setting ScriptMode="Release" is hiding the script error message. What I found in my situation is I was creating controls in Page_Init dynamically and they were being created with the same ID. I was also setting multiple selected items in a dynamically created ListBox when the SelectionMode was Single and not Multiple. I think in general if you're creating controls on the fly take care you're setting all the properties on the control correctly too...
  Permalink  
v4
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 5

When using FrameWork 4 and in GridView dynamically creating CheckBox, Button or other controls, events will fire in unusual order. Page_Load fires after create record.
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Cookies | Terms of Service
Web04-2016 | 2.8.181116.1 | Last Updated 7 Oct 2018
Copyright © CodeProject, 1999-2018
All Rights Reserved.
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100