Products » Support Forums 

Support Forums

HomeHomeDotNetNuke Modu...DotNetNuke Modu...Friendly Url Pr...Friendly Url Pr...NavigateURL to user controls in custom moduleNavigateURL to user controls in custom module
Previous
 
Next
New Post
8/3/2010 1:33 AM
 

I am developing a custom dnn module using vs2008 that has 3 user controls. I have installed the friendly url provider, copied the dll to my \bin folder and made all the recommended changes in the web.config. I get the friendly urls when navigating to regular dnn pages but when I use navigateurl() to navigate from the main user control of the module (ActiveTab.TabID) to another user control in the module I get the "ctl" and "mid" in the url.

Here is the navigate url statement I am using:

Response.Redirect(DotNetNuke.Common.Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "ProductDetails", "mid=" + ModuleId.ToString(), "", "&ProductID=" + ProductID + "&" + ProductName.Value));

Here is the url it gives me

http://localhost/dnn49cart276/Home/ctl/ProductDetails/mid/368/ProductID/22/Halo3-Xbox360.aspx

I am ok with having the "ProductID" parameter in the url but I would like to remove the "ctl" and the "mid/368" from the url.

I have spent a couple days on this and read all your doc and searched your forum/blog but can't come up with a solution. Most of the examples I have come across deal with navigating to regular dnn pages not user controls within a module. Please let me know if there is a solution.

Thanks in advance!

Dave

 
New Post
8/3/2010 5:27 AM
 

Yes, that's correct, the /ctl/ part of the Url will remain in the Url if it is supplied in the parameters for NavigateUrl. Generally, you would only use other controls in a module for editing/administration purposes, and not to show detail.

To remove this you will have to rethink the structure of your module. You would have to change it so that the current 'ProductDetails' module was another 'View' module within your module. The way I handle this particular situation is to put the 'detail' module on a separate DNN page, and then use module settings to link together your 'list' and 'detail' modules.

It's more work and messing around, but allows you much more flexibility in laying out your modules, and will give you more control later on. The other thing you will notice about using the 'ctl' and 'mid' parameters in the Url is that all other modules on the page 'disappear' because the page only shows that single control. If you're creating an ecommerce site, then that's a bad thing because (1) you can't use a different skin for the product list and detail pages and (2) you can't have other modules on the page : for example, help links, special offers, etc etc.

So my solution to the problem would be to rethink the structure of your module, and only use different module controls for administration purposes, not for general 'view' solutions.

 
New Post
8/3/2010 6:06 AM
 

Thanks very much for your answer! Looks like im creating a seperate module.for the details page

 
Previous
 
Next
HomeHomeDotNetNuke Modu...DotNetNuke Modu...Friendly Url Pr...Friendly Url Pr...NavigateURL to user controls in custom moduleNavigateURL to user controls in custom module


Support Guidelines.. Please read before posting

To get support on iFinity products and services, please search the forums for the the answer to the problem you are seeking. If you cannot find a solution, post a question in the relevant forum.   Ensure that you specify the relevant versions of the problem, and the actual error message or a detailed description of the problem.    You will need to register with this site to post on the forum.  If you have a Microsoft Live (Hotmail/Passport) account you can use that.  If you have a Open Id account you can use that.  If you neither of these, you will need to register a user Id and password.