Allen Joe
Allen Joe

Reputation: 1

get JSON file from remote Server

When I try to get json file from the server,using jquery method like this:

$.ajax({
                url: 'sample/0301_01.json',
                type: 'get',
                dataType:'json',
                success: function (data) {
                    alert("sdf");
                }
            });
And I using firefox browser to test the result. It turns out no error,but the server response message like that:An error occurred during the processing of /sample/0301_01.json. The page must have a <%@ webservice class="MyNamespace.MyClass" ... %> directive Can you help me?

Upvotes: 0

Views: 363

Answers (2)

Jijo John
Jijo John

Reputation: 1375

That's an exception thrown by the asp.net server which hosts the json file. You need to fix that error for getting the JSON file.

I think a namespace is missing from the .cs file in the asp.net server. Login to the ftp of that server and add the namespace.

        using <namespacename>; 

Read this msdn documentation about using c# namspaces

Upvotes: 1

Yevgeny Simkin
Yevgeny Simkin

Reputation: 28359

It sounds like your server doesn't know how to respond to sample/0301_01.json Have you tried visiting that page directly (without ajax - in a browser)?

Upvotes: 0

Related Questions