This virtual context url is not valid

Max De Los Reyes asked on March 14, 2023 00:15

Trying to use JavaScript's POST method to send data to a WebMethod, part of a custom WebService. Received error as in title: "This virtual context context url is not valid."

Code I am using to call the method: $.post( 'webservice.asmx/SaveConfiguration', { name:, objects_array: es.systemConfig.toString()});

I've made sure that the URL matches and the data names are exact.

I've also tried POSTing using AJAX, but that yielded an "Authentication failed" error. I've tried authorizing all users (*) in a local web.config, enabling sessions for the method, adding the [ScriptMethod] tag, enabling page methods using a script manager, and a variety of ways to submit the data, formatting-wise. Any other suggestions?


Recent Answers

answered on March 16, 2023 07:53 (last edited on March 30, 2023 10:38)

The error message "This virtual context context URL is not valid" indicates that there is an issue with the URL that you are using to call the WebMethod. Make sure that the URL is correct and that the WebMethod is accessible from the client-side.

Regarding the "Authentication failed" error when using AJAX, ensure that authentication is properly set up on the server-side and that the AJAX request includes the necessary authentication credentials.

You could also try enabling CORS (Cross-Origin Resource Sharing) on the server-side to allow cross-domain requests. Additionally, check the server-side logs for any relevant error messages or exceptions.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.