Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesCall a Webseervice from JQueryCall a Webseervice from JQuery
Previous
 
Next
New Post
11/4/2011 8:51 AM
 
Hi all

I try to move a piece of my old code to a DNN Module. The Code calls a Webservice (asmx) via JQuery and display's the Result.
I placed the ASMX File here : DesktopModules.MyModule.Service and the Code Behind into the App_Code\MyModule Folder.

I can call the Service directly via http://localhost/DNN/DesktopModules/myModule/Service/myService.asmx - no Problem so far :-)

But calling the Service from the Module with this Script

GetStats = function () {

    $.ajax(
    {
        type: "POST",
        url: "http://localhost/DNN/DesktopModules/myModule/Service/myService.asmx",
        data: '{}',
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        failure: function (msg) {
             Failure while call : " + msg);
        },
        error: function (xhr, err) {
             Error while call : " + err);
        },
        success: function (response) {

}
    });
};

Simply ends in a Error (The Code behind of the Service is never reached !?

What can I do ?

Kind Regards
Peter
 
New Post
11/4/2011 11:18 AM
 
OK, it seems that the URL is rewritten ?!

I enter "http://localhost/DNN/DesktopModules/myModule/Service/myService.asmx"
and the Code goes to this URL "/dnn/Default.aspx?tabid=82/myService.asmx"

How do I prevent this ?
 
New Post
11/4/2011 12:27 PM
 
Do you have any special URL re-writers installed? I don't believe DNN would  do this out of the box (at least I haven't experienced it in the past).

Ian

Software Engineer
Co-Founder, dnnGallery
Stack Overflow: Ian Robinson
Twitter: @irobinson
Linked In: Ian Robinson
 
New Post
11/7/2011 2:46 AM
 
Hi Ian

nope, it is DNN 6.01 out of the Box (new installed)
 
New Post
1/22/2014 1:02 AM
 
Check the name space in the .asmx file. It should be fully qualified.
 
Previous
 
Next
HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesCall a Webseervice from JQueryCall a Webseervice from JQuery


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out