Solved

??? Login won't redirect on server

Posted on 2011-02-24
4
353 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
Comment Utility
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
Comment Utility
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
Comment Utility

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
Comment Utility

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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This video discusses moving either the default database or any database to a new volume.

771 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now