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.0Does DNN have a procedure to redirect user back to referred page?Does DNN have a procedure to redirect user back to referred page?
Previous
 
Next
New Post
10/16/2006 3:56 PM
 

Hi,

I search through the libraries and didn't see any function for redirecting the user back to a referred page from. Does dnn provide this functionality?

I have created a user profile page and if the user is not logged in I redirect the user to the login page. After logining I want to redirect them back to their profile. Do I have to create a module for the login page just to provide this functionality?

thanks

 
New Post
10/16/2006 4:33 PM
 
We actually modified the core admin\security\signin.ascx.vb to add this functionality. Our mod looks something like this.

In Page_Load, after the test for IsPostback, we added something like:

            If Page.IsPostBack = False Then
                ' **************** BEGIN Core Modification **************************'
                ' save referrer to view state

                If Not Me.Request.UrlReferrer Is Nothing AndAlso Me.Request.UrlReferrer.AbsolutePath <> String.Empty Then
                    ViewState("SaveReferrer") = Me.Request.UrlReferrer.PathAndQuery
                Else
                    ViewState("SaveReferrer") = String.Empty
                End If





Then after the test for blnLogin:

            If blnLogin Then
                If objSecurity.UserLogin(txtUsername.Text, txtPassword.Text, PortalId, PortalSettings.PortalName, ipAddress, chkCookie.Checked) <> -1 Then

                    ' Store preferredlocale in cookie
                    Dim objUserInfo As UserInfo = objUsers.GetUserByUsername(PortalSettings.PortalId, txtUsername.Text)
                    CType(Page, PageBase).SetLanguage(objUserInfo.Profile.PreferredLocale)

                    ' **************** BEGIN Core Modification **************************'

                    Dim oReferrer As Object = ViewState("SaveReferrer")
                    If oReferrer Is Nothing OrElse CType(oReferrer, String) = String.Empty Then
                        'if there is no saved referrer, go to default (which is current page without querystring)
                        ' redirect browser - override is used if the user defined login tab has no signin control
                        If PortalSettings.HomeTabId <> -1 And Request.QueryString("override") Is Nothing Then
                            ' user defined tab
                            Response.Redirect(NavigateURL(PortalSettings.HomeTabId), True)
                        Else
                            Response.Redirect(NavigateURL(), True)
                        End If
                    Else
                            Dim referrerPath As String = CType(oReferrer, String)
                            Response.Redirect(referrerPath, True)
                    End If


WildVoice.com Michael Levy - Are you ready to be heard? WildVoice.com
 
New Post
10/16/2006 5:02 PM
 

How do I tell DNN to set the SaveReferrer in code to the page I want it to return to?

 

thanks

 
New Post
10/16/2006 5:13 PM
 

I go it to work. All i had to do was change my orginal implementation. I was going to create my own refer redirect  to use a querystring with the name returnUrl and in fact the login control uses the same name just with returnurl. I guess the returnUrl through it off.

 

thanks for your time.

 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Does DNN have a procedure to redirect user back to referred page?Does DNN have a procedure to redirect user back to referred page?


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