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.0How to get right PortalAlias when calling FriendlyUrl from SchedulerHow to get right PortalAlias when calling FriendlyUrl from Scheduler
Previous
 
Next
New Post
10/18/2009 8:47 PM
 

I have a scheduled task that creates a PortalSettings object. It then calls the FriendlyUrl method to create a FURL , but whenever it runs from the Scheduler it uses the wrong portalAlias (that particular portal has many aliases but only one (pokerdiy.com) is correct). Calling it from a module instance works fine.

return FriendlyUrlProvider.Instance().FriendlyUrl(leagueDetailTab, "~/Default.aspx?tabid=" + leagueDetailTab.TabID.ToString() + "&lid=" + leagueID.ToString(), Utilities.formatTitle(leagueName), portalSettings);

I also tried the PortalAlias overload but with no joy. Is it a problem in the FURL provider or do I have to somehow set the PortalSettings to tell it WHICH portalAlias is the default?


Entrepreneur

PokerDIY Tournament Manager - PokerDIY Tournament Manager<
PokerDIY Game Finder - Mobile Apps powered by DNN
PokerDIY - Connecting Poker Players

 
New Post
10/19/2009 12:03 AM
 

Rodney - the portalSettings object is created by the Url Rewriter at the start of each request for a DNN page or resource.  The portalSEttings object lets all subsequent code know which portal a particular request belongs to (remember that all DNN installs are a single IIS website).  This is done by identifying either the tabid (which links back to the portal) or by matching the portal alias.

So, in answer to your question, yes, you will have to specify which portal alias is current for your constructed portalSettings object.  You'll need to do this when you instance the portal settings.  If you're using my code (in blog post http://www.ifinity.com.au/Blog/Technical_Blog/EntryId/52/Creating-PortalSettings-Instance-running-in-a-DotNetNuke-Schedule-Item) you'll see that in that code, the portal alias chosen is arbitarily picked as the first one for the portal.  Depending on your actual needs, you may need to change this code so that you use a particular, chosen portal alias instaed of just the first one in the list.

Note that it's not a problem in the Friendly Url Provider because in the overload you're using, you are specifying the portalSEttings object to use, which indirectly supplies which portal alias to use.

-Bruce

 
New Post
10/19/2009 1:40 AM
 

Thanks Bruce, I knew you'd know ;)

I have made another overload for your CreateNewPortalSettings method which takes in a PreferredPortalAlias - if it can retrieve it it will use that or use the first as before. For anyone who is doing this in a Scheduled Task who has multiple portalAliases you may need this...

Thanks for the help.


Entrepreneur

PokerDIY Tournament Manager - PokerDIY Tournament Manager<
PokerDIY Game Finder - Mobile Apps powered by DNN
PokerDIY - Connecting Poker Players

 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0How to get right PortalAlias when calling FriendlyUrl from SchedulerHow to get right PortalAlias when calling FriendlyUrl from Scheduler


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