简体   繁体   中英

AJAX calls in IFRAME

So i created game (backend in c#). If you click on some image, AJAX will handle this and call function in backend c#. This works perfectly on my website. But if i am trying to do this on school website, where they use iframe to show my website, then these AJAX calls return internal server error 500.

Here is error message from server.

2021-05-15 19:12:49.262 +00:00 [Error] Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware: An unhandled exception has occurred while executing the request.

System.ArgumentNullException: Buffer cannot be null. (Parameter 'buffer')at

System.IO.MemoryStream..ctor(Byte[] buffer, Boolean writable)at

System.IO.MemoryStream..ctor(Byte[] buffer)at

Microsoft.AspNetCore.Http.SessionExtensionsTuke.GetObject(ISession session, String key) in C:\Users\adamb\Desktop\bak\bakalarka-appka\Bakalarka\SessionExtensionsTuke.cs:line 12at Bakalarka.Controllers.GameController.Choose(Int32 index) in C:\Users\adamb\Desktop\bak\bakalarka-appka\Bakalarka\Controllers\GameController.cs:line 29at lambda_method(Closure, Object, Object[] )at

Microsoft.Extensions.Internal.ObjectMethodExecutor.Execute(Object target, Object[] parameters)at

Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.SyncActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)at

Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeActionMethodAsync()at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)at

Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeNextActionFilterAsync()--- End of stack trace from previous location where exception was thrown ---at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)at

Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)at

Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.g__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)at

Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|24_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)at

Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context)at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)at

Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|19_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)at

Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)at Microsoft.AspNetCore.Routing.EndpointMiddleware.g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)at

Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)at Microsoft.AspNetCore.Session.SessionMiddleware.Invoke(HttpContext context)at

Microsoft.AspNetCore.Session.SessionMiddleware.Invoke(HttpContext context)at

Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)at

Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware.g__Awaited|6_0(ExceptionHandlerMiddleware middleware, HttpContext context, Task task)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM