Click here to Skip to main content
13,897,811 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;

    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:Panel ID="Panel3" runat="server">
    <asp:UpdatePanel ID="UpdatePanel3" runat="server" UpdateMode="Conditional">
 <asp:LinkButton ID="LinkButton100" CssClass="calendar" 

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

 <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:Panel ID="Panel1" CssClass="popup" runat="server">
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="False">
             <asp:Literal ID="Literal1" runat="server"></asp:Literal><br />
             <asp:Literal ID="Literal2" runat="server"></asp:Literal><br />
             <asp:Literal ID="Literal3" runat="server"></asp:Literal><br />
        <asp:AsyncPostBackTrigger ControlID="LinkButton60" EventName="Click" />
         <asp:AsyncPostBackTrigger ControlID="LinkButton120" EventName="Click" />
 <asp:BalloonPopupExtender ID="BalloonPopupExtender1" BalloonPopupControlID="Panel1"Position="TopRight" 

     TargetControlID="LinkButton60" runat="server" 


     DynamicContextKey='1' DynamicControlID="Panel1"


<asp:Panel ID="Panel2" runat="server" 

<asp:UpdatePanel ID="UpdatePanel2" runat="server" 

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

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



           <asp:AsyncPostBackTrigger ControlID="LinkButton60" 

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

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

        runat="server" Position="Bottom" 

        PopupControlID="Panel2" DynamicContextKey="value" 





The web service method:
       public string PlaceHolder1_DynamicPopulateExtender(string contextKey)
.............builds a string, s
           return s.ToString();

ANY IDEAS what the problem is? or how can find it???
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Set ScriptMode="Release" of your ScriptManager.
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 works!!!! :)
BD Innovative 10-Mar-14 12:03pm
nice bro
Rate this: bad
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...
Rate this: bad
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.

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
Web05 | 2.8.190306.1 | Last Updated 7 Oct 2018
Copyright © CodeProject, 1999-2019
All Rights Reserved.
Layout: fixed | fluid

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