try this (from Admin/Skins/Login.ascx.vb):
1: Try
2: Dim ReturnUrl As String = HttpContext.Current.Request.RawUrl
3: If ReturnUrl.IndexOf("?returnurl=") <> -1 Then
4: ReturnUrl = ReturnUrl.Substring(0, ReturnUrl.IndexOf("?returnurl="))
5: End If
6: ReturnUrl = HttpUtility.UrlEncode(ReturnUrl)
7:
8: If PortalSettings.LoginTabId <> -1 And Request.QueryString("override") Is Nothing Then
9: ' user defined tab
10: Response.Redirect(NavigateURL(PortalSettings.LoginTabId, "", "returnurl=" & ReturnUrl), True)
11: Else
12: ' portal tab
13: If PortalSettings.HomeTabId <> -1 Then
14: Response.Redirect(NavigateURL(PortalSettings.HomeTabId, "Login", "returnurl=" & ReturnUrl), True)
15: Else
16: Response.Redirect(NavigateURL(PortalSettings.ActiveTab.TabID, "Login", "returnurl=" & ReturnUrl), True)
17: End If
18: End If
19: Catch exc As Exception 'Module failed to load
20: ProcessModuleLoadException(Me, exc)
21: End Try
Hope it helps,