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.0Re-Direct To LoginRe-Direct To Login
Previous
 
Next
New Post
4/5/2007 9:53 AM
 

Hi,

I am developing a module which is based on the announcements module.  I am adding the functionality to store a file against an article.  Only registered users should be able to download the file via the link.  Can anyone tell me how to code my link so that if an anonymous user clicks on the link they are re-directed to the login page?

Any help on this would be greatly appreciated.

DClayton


For all your software needs.....www.softwareknowhow.info
 
New Post
4/6/2007 8:02 AM
 

why not just put the file in a folder that restricts access? Then all you have to do is make sure you offer a download link using linkclick.aspx and then dnn takes care of the rest. Have a look at the documents module to see how it is all done...


Erik van Ballegoij, Former DNN Corp. Employee and DNN Expert

DNN Blog | Twitter: @erikvb | LinkedIn: Erik van Ballegoij on LinkedIn

 
New Post
4/10/2007 10:31 AM
 

Thanks for your help.  I have managed to get this working as suggested.  BUT, when an anonymous user clicks on the link, they are re-directed to a page displaying the message "You Do Not Have Permission To View The Requested File".  Is there any way to change this so that it re-directs the user to the login page for the site?


For all your software needs.....www.softwareknowhow.info
 
New Post
4/10/2007 6:08 PM
 

I have the same question. when my code detects the user is not authenticated, it  needs to redirect the user to login page. Can anybody tell me where I can find an examle in the core.

thanks a lot

Frank

 
New Post
4/10/2007 10:09 PM
 

Try something like the following in your code
 -  this will redirect you to the LOGIN tab if not logged on and then return you to the current URL once you have logged in succesfully.

If Not Request.IsAuthenticated then

     dim  RedirectURL as string = NavigateURL(PortalSettings.LoginTabId, "", "returnurl=" & HttpUtility.UrlEncode _(HttpContext.Current.Request.RawUrl))

      Response.Redirect(RedirectURL, True)

EndIf

 

 

 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Re-Direct To LoginRe-Direct To Login


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