web services - Calling a webservice from a subfolder -


I am using ASP.net and I am trying to execute a webmath from jquery. I have the following file structure:

/ MyWebService.asmx
/ MyPage1.aspx (refers to a javascript file that tells a webmath in MyWebService.asmx)
MySubFolder / MyPage2.aspx (MyPage2 .aspx refers to the same Javascript file)

My problem is that MyPage1.aspx can call webmath in web service but MyPage2.aspx can not. Any ideas why? It should be related to the fact that MyPage2.aspx is in the subfolder if I just move MyPage2.aspx to the root.

I am using jquery and the code in the javascript file looks like this:

$ Ajax ({
Type: "Post",
url: "MyWebService.asmx / MyWebMethod",
Data: "{}",
contentType: "application / json; charset = utf- 8 ",
DataType:" json ",
Success: function (msg)
etc.

I tried to change url in this way: / MyWebService.asmx / MyWebMethod ( But it does not matter.

Thank you.

< P> I think it is appropriate to try to pass a relative URL like "..// MyWebService.asmx / MyWebMethod".

Personally, I complete the AJAX hit I prefer to pass the URL.


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -