I am trying to create a DNN module by following Clint Patterson's tutorial from 2014. When I get to the Hello World Web API test I get a 404 error. Research shows that Web API changed in DNN 9.4 and I am wondering if this is the cause of my 404. If so, what is the proper way to do a Web Api call now?
Later... got this to work, so no worries. Thanks.
I found that the URL I was using was actually pointing to the installed version of the module. I thought I was following instructions properly by creating a new subfolder in DesktopModules that would be unique, and then I put my development files in a subfolder there. So I have DesktopModules/ETI/ProfileUpdate folder with my VS files in it. When I installed the install.zip into DNN, it placed the install in DesktopModules/ProfileUpdate. So I actually had two versions then, the development one and the installed one.
I got the HelloWorld URL to work by doing an install of the latest version of the project and all worked fine.
Later I discovered that the JSON call did not resolve to the full URL when I specified "/DesktopModules/ProfileUpdate/API/ModuleFields/GetFields?moduleID=123" and it was lacking the protocol and domain. I then updated it to:
$.getJSON( location.origin + "/dotnetnuke" + "/DesktopModules/ProfileUpdate/API/ModuleFields/GetFields?moduleID=123", function (result) { var parsedTaskJSONObject = jQuery.parseJSON(result); console.log(parsedTaskJSONObject); });
to get it to work, still knowing that I needed a proper solution if I was to deploy it.
I am now thinking that there must be a better way, since I simply want to create a module that allows an admin to set a value on some particular element of a user's Profile whenever that module is on a certain page. User goes to that page; that value gets set in their Profile.
Clint Patterson did an amazing job of putting that tutorial together, but as Joe says above, it is from 2014 and I find myself always wondering if things still work the same way as in the tutorial or if there is now a better way.
I tried Chris Hammond's video on creating and packaging a module (#11), but didn't find the coding detail that Clint had. I've just discovered his #14 video, so I am going to try that.
These Forums are dedicated to the discussion of DNN Platform.
For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:
Awesome! Simply post in the forums using the link below and we'll get you started.