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 ExtensionsModulesModulesHow to get a controlHow to get a control's Url from a web service in the same module
Previous
 
Next
New Post
6/16/2010 12:50 PM
 
I have a module that includes a web service. The web service needs to get the Url of a control in the same module. As the web service doesn't run as a control itself, it has no access to the EditUrl method usually available to module controls.

The url should look something like the following, and needs to work with the FriendlyUrl providers:
http://localhost/dnn5/Licensing/tabid/287/ctl/Verify/mid/707/Default.aspx
Can anyone suggest how I can extract the Url? My instinct was to try to create an instance of the control and pass it into the ModuleInstanceContext constructor like in the snippet below:

   ModuleController mc = new ModuleController();
   TabController tc = new TabController();
   _portalSettings = PortalController.GetCurrentPortalSettings();
   ModuleInfo mi = mc.GetModuleByDefinition(_portalSettings.PortalId, Definition.ModuleFriendlyName);
   IModuleControl ctrl = ???????????
   ModuleInstanceContext mic = new ModuleInstanceContext(ctrl);
   _verificationUrl = string.Format("http://{0}", mic.EditUrl());

However, I can't find a way to instantiate a module control. Can anyone help, or suggest another way to solve this problem?

Any help appreciated.


Paul Taylor
Dotcom Software Solutions Ltd
DotNetNuke, ASP.NET and SQL Server Development
 
New Post
6/17/2010 5:53 AM
 
Found it. The following gets the Url I need:

url = Globals.NavigateURL(ti.TabID, "Key", string.Format("mid={0}", mi.ModuleID));



Paul Taylor
Dotcom Software Solutions Ltd
DotNetNuke, ASP.NET and SQL Server Development
 
Previous
 
Next
HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesHow to get a controlHow to get a control's Url from a web service in the same module


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