Solved

??? Login won't redirect on server

Posted on 2011-02-24
4
358 Views
Last Modified: 2012-05-11
Hi EE,

This is so weird to me but, when I'm testing my web on my local machine my redirect works, when hosted on server, it doesn't redirect.
I tried several ways to redirect but none of them work.
What could be causing this?
The site is service2020.com.
Test user = testing, password = testing1

Thanks
Private Sub Login1_LoggedIn(ByVal sender As Object, ByVal e As System.EventArgs) Handles Login1.LoggedIn
      Dim r As String = String.Empty
      If String.IsNullOrEmpty(Request.QueryString("ReturnUrl")) Then
         ' please don't use User.IsInRole here , because it will not be populated yet at this stage.  
         If Roles.IsUserInRole(Login1.UserName, "admin") Then
            ' r = "Service2020/Stylist/Client_Services.aspx"

            Response.Redirect("Stylist/Client_Services.aspx")
         ElseIf Roles.IsUserInRole(Login1.UserName, "Client") Then
            Response.Redirect("Clients/Default.aspx")
         ElseIf Roles.IsUserInRole(Login1.UserName, "Stylist") Then
            Response.Redirect("Stylist/Client_Services.aspx")
         ElseIf Roles.IsUserInRole(Login1.UserName, "Other") Then
            Response.Redirect("Stylist/Client_Services.aspx")
         End If
         If Session("UserID") = Nothing Then
            Dim s As String = Nothing
            Dim u As New SalonUtilities
            s = u.CheckSessionAndReturnUser
         End If
      Else
         r = "string empty"
      End If
   End Sub

Open in new window

0
Comment
Question by:Sheritlw
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 4

Expert Comment

by:ong-hh
ID: 34976107
Are you testing on the server using IE?
If Yes, please check the security tab in internet options.
By default the security are set to high, set to medium/medium low.
0
 
LVL 21

Accepted Solution

by:
Alfred1 earned 500 total points
ID: 34976143
Try redirecting by setting the endResponse parameter to true.

Response.Redirect("Stylist/Client_Services.aspx", true)

http://msdn.microsoft.com/en-us/library/a8wa7sdt%28v=VS.100%29.aspx


0
 

Author Comment

by:Sheritlw
ID: 34976223

Putting the true in the response worked, somewhat.

Another weird thing... It redirected to the correct page, but only the menu (from master page) shows and not the context page.
I have to re-load in order to show the whole page????

What's going on?

Thanks
0
 

Author Comment

by:Sheritlw
ID: 34976622

Not sure what is going on with the blank page, but I imagine it has something to do with the page and not with the redirect.

Thank you for your help.
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

624 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question