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

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0A couple of question about modules and web servicesA couple of question about modules and web services
Previous
 
Next
New Post
1/3/2008 10:33 PM
 

A couple of question about modules and web services.

1) I have different modules on a page and I want each to call a webservice. I have the following code in one of the modules:

DotNetNuke.Framework.AJAX.RegisterScriptManager();
ScriptManager objScriptManager = ScriptManager.GetCurrent(this.Page);

ServiceReference objServiceReference = new ServiceReference();
objServiceReference.Path = this.ModulePath + "AjaxChatService1.asmx";
objScriptManager.Services.Add(objServiceReference);

ScriptReference objScriptReference = new ScriptReference();
objScriptReference.Path = this.ModulePath + "JSWebService.js";
objScriptManager.Scripts.Add(objScriptReference);

Can someone provide me some actual code to check if there is already a script manager on the page and how best to insure that there is only one.

2) I am using Ajax.NET and the following pageLoad callback function in my modules:

function pageLoad(sender, args) {
}

but it seems like only the last module on the page gets its pageLoad function called. Is that correct? That only one pageLoad function will be called per page?

thank you
Nick

 
New Post
1/4/2008 12:21 PM
 

Nick,

A quick thought on #1 -- doesn't DotNetNuke.Framework.AJAX.RegisterScriptManager take care of registering a script manager (and making sure there is only one registered)? My thought was that if you are using that everywhere to handle the creation of script managers, you wouldn't run into any issues with multiples.

Sorry I don't have any feedback on #2, but maybe being bumped to the top of the forum list again will help :)

take care,

Ian


Software Engineer
Co-Founder, dnnGallery
Stack Overflow: Ian Robinson
Twitter: @irobinson
Linked In: Ian Robinson
 
New Post
1/4/2008 10:44 PM
 

Ian

Thanks for your response. Where did you learn that? I've read a few books now on DotNetNuke but don't recall that. Is there an API document somewhere? I do believe what you're saying, it makes sense.

thanks

Nick

 
New Post
1/5/2008 3:04 PM
 

Nick,

I cannot say exactly where I picked up that bit of knowledge, but I read quite a few blogs and browse the DNN forums regularly. I also work with a bunch of guys that are doing DNN development all day long :)

Michael Washington has quite a good walkthrough on the DNN/ASP.NET AJAX stuff here: Creating a DotNetNuke module using ASP.NET Ajax

One of the main take aways from that is that you should probably be using the following code when using ASP.NET Ajax features:

If DotNetNuke.Framework.AJAX.IsInstalled Then
    DotNetNuke.Framework.AJAX.RegisterScriptManager()
End If

Take care,

Ian


Software Engineer
Co-Founder, dnnGallery
Stack Overflow: Ian Robinson
Twitter: @irobinson
Linked In: Ian Robinson
 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0A couple of question about modules and web servicesA couple of question about modules and web services


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