0

Followed below article to call web method which is in application page code behind from client side script. I always getting "The file does not exist" error message.

Environment : SharePoint 2019

https://social.msdn.microsoft.com/Forums/en-US/7bebbb0c-c27c-43c6-a4c4-0b60a70d0682/call-server-side-method-from-client-side-using-page-method-in-application-page-in-sharepoint-2010?forum=sharepointdevelopmentprevious

$.ajax({
                type: "POST",
                Url: "/_layouts/SolutionName/AppPage.aspx/Test",
                data: "{}",
                contentType: "application/json",
                dataType: "application/json",
                success: function (msg) { alert("Success"); },
                error: function (xhr, status, errorThrown) { alert(xhr +"&&"+ status +"&&"+ errorThrown); }
            });

The file '.aspx' does not exist.\r\n at System.Web.UI.Util.CheckVirtualFileExists(VirtualPath virtualPath)\r\n at System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate)\r\n at System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate)\r\n at System.Web.Compilation.BuildManager.GetVirtualPathObjectFactory(VirtualPath virtualPath, HttpContext context, Boolean allowCrossApp, Boolean throwIfNotFound)\r\n at System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath(VirtualPath virtualPath, Type requiredBaseType, HttpContext context, Boolean allowCrossApp)\r\n at System.Web.UI.PageHandlerFactory.GetHandlerHelper(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath)\r\n at System.Web.HttpApplication.MaterializeHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()\r\n at System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step)\r\n at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.