在将我的blazor项目从.net预览7更新到.net核心3.0.100版本之后,我在sycfusion控件中获得了以下错误,通过引用https://devblogs.microsoft.com/aspnet/asp-net-core-and-blazor-updates-in-net-core-3-0-preview-9/更新了所有最新的packages.also更新语法更改
`blazor.server.js:8 Uncaught (in promise) Error: System.ArgumentException: The call to 'UpdateTemplate' expects '5' parameters, but received '4'. at
Microsoft.JSInterop.Infrastructure.DotNetDispatcher.ParseArguments(JSRuntime jsRuntime, String methodIdentifier, String arguments, Type[] parameterTypes)
at Microsoft.JSInterop.Infrastructure.DotNetDispatcher.InvokeSynchronously(JSRuntime jsRuntime, DotNetInvocationInfo& callInfo, IDotNetObjectReference objectReference, String argsJson)
at Microsoft.JSInterop.Infrastructure.DotNetDispatcher.BeginInvokeDotNet(JSRuntime jsRuntime, DotNetInvocationInfo invocationInfo, String argsJson)
at Object.endInvokeDotNetFromJS (blazor.server.js:8)
at e.<anonymous> (blazor.server.js:8)
at blazor.server.js:1
at Array.forEach (<anonymous>)
at e.invokeClientMethod (blazor.server.js:1)
at e.processIncomingData (blazor.server.js:1)
at e.connection.onreceive (blazor.server.js:1)
at WebSocket.i.onmessage (blazor.server.js:1)
endInvokeDotNetFromJS @ blazor.server.js:8
(anonymous) @ blazor.server.js:8
(anonymous) @ blazor.server.js:1
e.invokeClientMethod @ blazor.server.js:1
e.processIncomingData @ blazor.server.js:1
connection.onreceive @ blazor.server.js:1
i.onmessage @ blazor.server.js:1
<EjsGrid ID="gdProjects" @ref="gdProjects" ModelType="@model" DataSource="@filteredProjects" AllowReordering="true" AllowFiltering="true" AllowPaging="true" AllowMultiSorting="false" AllowSorting="true" AllowExcelExport="true" AllowPdfExport="true" Toolbar="@(new List<string>() { "Search" })">
<GridFilterSettings Type="@Syncfusion.EJ2.Blazor.Grids.FilterType.Menu"></GridFilterSettings>
<GridPageSettings PageCount="10" PageSizes="true"></GridPageSettings>
<GridColumns>
<GridTemplates>
<RowTemplate>
@{
var project = (context as ProjectTable);
<td class="data-cell pointer" @onclick="(()=>OnProjectClick(project.ProjectId))">
@project.ProjectName
</td>
<td class="data-cell pointer" @onclick="(()=>OnClientClick(project.ClientId))">
@project.ClientName
</td>
<td class="data-cell">
@project.Status
</td>
<td class="data-cell">
@project.NextStep
</td>
<td class="data-cell">
@project.DueDate
</td>
}
</RowTemplate>
</GridTemplates>
<GridColumn Field=@nameof(ProjectTable.ProjectName) HeaderText="Project Name" />
<GridColumn Field=@nameof(ProjectTable.ClientName) HeaderText="Client Name" />
<GridColumn Field=@nameof(ProjectTable.Status) HeaderText="Status" />
<GridColumn Field=@nameof(ProjectTable.NextStep) HeaderText="Next Step" />
<GridColumn Field=@nameof(ProjectTable.DueDate) HeaderText="Due Date" />
</GridColumns>
</EjsGrid>`发布于 2019-10-17 05:40:36
我猜在Nuget(Syncusion.EJ2.Blazor)和ejs.interop.min.js文件之间存在版本不匹配。请确保使用相同版本的脚本文件来解决此错误。
例如,如果您使用的是Nuget v17.3.17,那么脚本文件应该从下面的CDN引用。
<script src="https://cdn.syncfusion.com/ej2/17.3.17/dist/ejs.interop.min.js"></script>
参考: https://ej2.syncfusion.com/blazor/documentation/grid/getting-started/
https://stackoverflow.com/questions/58410956
复制相似问题