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 ExtensionsModulesModulesjQuery calling module methodsjQuery calling module methods
Previous
 
Next
New Post
12/2/2011 11:48 AM
 

Does anyone know of an example of creating a DNN module that emits jQuery code and then uses it to call back into the DNN module?  I know that in general you can't create WebMethods in Usercontrols as they do not get registered on the page.  Does DNN give anything to support this?  I know I can create a web service or http web handler file (.ashx), but I need to use the settings in the DNN module in the WebMethod when it is called.   I would think this would be a pretty common pattern for modern DNN modules.

Thanks for any help.

 
New Post
12/2/2011 12:30 PM
 

One way of doing this would be to emit a jQuery object that stores the module settings you'll need for communicating with the server. Then you could set up any handler/service on the server side to communicate with and just pass in whatever context you'd need.

A simple example off the top of my head would be to write something like this in your ASCX file:

var myModuleSettings = {
  displayProfile: <%= Settings["DisplayProfile"].ToString() %>
};

Ian


Software Engineer
Co-Founder, dnnGallery
Stack Overflow: Ian Robinson
Twitter: @irobinson
Linked In: Ian Robinson
 
New Post
12/2/2011 12:32 PM
 

Also - 

I've never actually used it, but I think the Client API provides some functionality that may be helpful. I think it basically allows you to approximate page methods: http://webcontrols.dotnetnuke.com/cli...

Ian



Software Engineer
Co-Founder, dnnGallery
Stack Overflow: Ian Robinson
Twitter: @irobinson
Linked In: Ian Robinson
 
New Post
12/2/2011 12:47 PM
 

Thanks for the lightning fast reply Ian!  Unfortunately I can't pass the module settings I need to the client as they are actually login credentials for a third party service that takes http requests (the data they return is not sensitive but the login credentials obviously are)

Your second post looks interesting.  Will check it out.

 
Previous
 
Next
HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesjQuery calling module methodsjQuery calling module methods


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