问题描述
我收到以下错误:
Microsoft JScript运行时错误:Sys.ArgumentNullException:值不能为null。
参数名称:panelsCreated [1]
同时指向文件中的以下代码(ScriptResource.axd ... [dynamic]):
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();
}
行:if(e)throw e突出显示。
这个当我在LinkButton上连续第二次或第三次点击时发生。
LinkButton成功调用/执行WebService方法,然后产生错误!
LinkButton代码如下:
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:
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???
ANY IDEAS what the problem is? or how can find it???
推荐答案
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:
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:
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???
ANY IDEAS what the problem is? or how can find it???
这篇关于Microsoft JScript运行时错误:Sys.ArgumentNullException:值不能为null的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!