Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

??? Login won't redirect on server

Posted on 2011-02-24
4
Medium Priority
?
361 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
  • 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:
Alfred A. earned 2000 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…

927 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