Hey Roger,
Here is a utility method that gets the current portal's login URL.
Public Shared Function GetLoginUrl(ByVal portalSettings As PortalSettings, ByVal request As HttpRequest) As String
If ((portalSettings Is Nothing) OrElse (request Is Nothing)) Then
Throw New ArgumentNullException(IIf((portalSettings Is Nothing), "portalSettings", "request"))
End If
Dim tabID As Integer = portalSettings.ActiveTab.TabID
Dim controlKey As String = "Login"
Dim rawUrl As String = request.RawUrl
If (rawUrl.IndexOf("?returnurl=", StringComparison.OrdinalIgnoreCase) > -1) Then
rawUrl = rawUrl.Substring(0, rawUrl.IndexOf("?returnurl=", StringComparison.OrdinalIgnoreCase))
End If
rawUrl = HttpUtility.UrlEncode(rawUrl)
If (Not Null.IsNull(portalSettings.LoginTabId) AndAlso String.IsNullOrEmpty(request.QueryString.Item("override"))) Then
controlKey = String.Empty
tabID = portalSettings.LoginTabId
ElseIf Not Null.IsNull(portalSettings.HomeTabId) Then
tabID = portalSettings.HomeTabId
End If
Return Globals.NavigateURL(tabID, controlKey, New String() { ("returnUrl=" & rawUrl) })
End Function
http://stackoverflow.com/questions/1246570/how-do-i-get-the-portals-current-login-url-in-dotnetnuke
Hope that helps,
Ian