Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. redirection problem

redirection problem

Scheduled Pinned Locked Moved ASP.NET
helpasp-netcomwindows-admintutorial
6 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    acont
    wrote on last edited by
    #1

    I have created a web chat application, to get to the webchat user has to login using his username and password. When I was developing my application the redirection sometimes was working, and sometimes not, I didn't really know why, but I wasn't bothered about that then. Now I wanted to access my webpage by using IIS, I was following this tutorial: http://www.codeproject.com/KB/aspnet/IIS7ASPNet.aspx The login page is with this adress: http://localhost/Smiths1/Default.aspx and it should redirect me to: http://localhost/Smiths1/SmithChat.aspx?roomID=14 but I don't know why it redirects me to: http://localhost/Smiths1/Default.aspx?ReturnUrl=%2FSmiths1%2FSmithChat.aspx%3FroomID%3D14&roomID=14 and I can't get to the webchat (I still see the login page, but I assume it;s only because the name of it is Default.aspx). The instruction in login page looks like that: Response.Redirect("SmithChat.aspx?roomID=14", true); I don't know what causes whis "error", could someone help me please?

    A L H 3 Replies Last reply
    0
    • A acont

      I have created a web chat application, to get to the webchat user has to login using his username and password. When I was developing my application the redirection sometimes was working, and sometimes not, I didn't really know why, but I wasn't bothered about that then. Now I wanted to access my webpage by using IIS, I was following this tutorial: http://www.codeproject.com/KB/aspnet/IIS7ASPNet.aspx The login page is with this adress: http://localhost/Smiths1/Default.aspx and it should redirect me to: http://localhost/Smiths1/SmithChat.aspx?roomID=14 but I don't know why it redirects me to: http://localhost/Smiths1/Default.aspx?ReturnUrl=%2FSmiths1%2FSmithChat.aspx%3FroomID%3D14&roomID=14 and I can't get to the webchat (I still see the login page, but I assume it;s only because the name of it is Default.aspx). The instruction in login page looks like that: Response.Redirect("SmithChat.aspx?roomID=14", true); I don't know what causes whis "error", could someone help me please?

      A Offline
      A Offline
      Abhijit Jana
      wrote on last edited by
      #2

      You problem is not clear. please rephrase your question.

      Cheers ! Abhijit Jana | MVP Web Site : abhijitjana.net | Follow Me @ twitter Don't forget to click "Good Answer" on the post(s) that helped you.

      A 1 Reply Last reply
      0
      • A acont

        I have created a web chat application, to get to the webchat user has to login using his username and password. When I was developing my application the redirection sometimes was working, and sometimes not, I didn't really know why, but I wasn't bothered about that then. Now I wanted to access my webpage by using IIS, I was following this tutorial: http://www.codeproject.com/KB/aspnet/IIS7ASPNet.aspx The login page is with this adress: http://localhost/Smiths1/Default.aspx and it should redirect me to: http://localhost/Smiths1/SmithChat.aspx?roomID=14 but I don't know why it redirects me to: http://localhost/Smiths1/Default.aspx?ReturnUrl=%2FSmiths1%2FSmithChat.aspx%3FroomID%3D14&roomID=14 and I can't get to the webchat (I still see the login page, but I assume it;s only because the name of it is Default.aspx). The instruction in login page looks like that: Response.Redirect("SmithChat.aspx?roomID=14", true); I don't know what causes whis "error", could someone help me please?

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        I think it is redirecting to default page because it is not finding SmithChat.aspx page on it's path.

        Jinal Desai - LIVE Experience is mother of sage....

        1 Reply Last reply
        0
        • A Abhijit Jana

          You problem is not clear. please rephrase your question.

          Cheers ! Abhijit Jana | MVP Web Site : abhijitjana.net | Follow Me @ twitter Don't forget to click "Good Answer" on the post(s) that helped you.

          A Offline
          A Offline
          acont
          wrote on last edited by
          #4

          I think I should start with showing you my code in the login page (I'm using prepared asp login component): public partial class _Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } protected void Login1_Authenticate(object sender, AuthenticateEventArgs e) { SmithChatDataContext data = new SmithChatDataContext(); var user = (from u in data.Users where u.Username == Login1.UserName && u.Password == Login1.Password select u).SingleOrDefault(); if (user != null) { e.Authenticated = true; Session["ChatUserID"] = user.UserID; Session["ChatUsername"] = user.Username; Response.Redirect("SmithChat.aspx?roomID=14", true); } else { e.Authenticated = false; } } } and when I run the page from the Visual Studio, it goes to the login page, when I'm trying to login - sometimes it redirects me to the webchat as it should, and sometimes the link after authentication looks like that: http://localhost:49786/Smiths/Default.aspx?ReturnUrl=%2FSmiths%2FSmithChat.aspx%3FroomID%3D14&roomID=14 and I'm still on the login page. I don't know what is wrong. Anyway, I tried to deploy my application using IIS, so I followed the tutorial which I mentioned about before, and my login page is accessible (http://localhost/Smiths1/Default.aspx) However, after authentication it stays on the login page and the link again looks like that: http://localhost/Smiths1/Default.aspx?ReturnUrl=%2FSmiths1%2FSmithChat.aspx%3FroomID%3D14&roomID=14

          1 Reply Last reply
          0
          • A acont

            I have created a web chat application, to get to the webchat user has to login using his username and password. When I was developing my application the redirection sometimes was working, and sometimes not, I didn't really know why, but I wasn't bothered about that then. Now I wanted to access my webpage by using IIS, I was following this tutorial: http://www.codeproject.com/KB/aspnet/IIS7ASPNet.aspx The login page is with this adress: http://localhost/Smiths1/Default.aspx and it should redirect me to: http://localhost/Smiths1/SmithChat.aspx?roomID=14 but I don't know why it redirects me to: http://localhost/Smiths1/Default.aspx?ReturnUrl=%2FSmiths1%2FSmithChat.aspx%3FroomID%3D14&roomID=14 and I can't get to the webchat (I still see the login page, but I assume it;s only because the name of it is Default.aspx). The instruction in login page looks like that: Response.Redirect("SmithChat.aspx?roomID=14", true); I don't know what causes whis "error", could someone help me please?

            H Offline
            H Offline
            HardikSitapara
            wrote on last edited by
            #5

            try this Response.Redirect("SmithChat.aspx?roomID=14", false);

            A 1 Reply Last reply
            0
            • H HardikSitapara

              try this Response.Redirect("SmithChat.aspx?roomID=14", false);

              A Offline
              A Offline
              acont
              wrote on last edited by
              #6

              Thanks, but I've tried that already. It's not redirecting anywhere at all when this boolean is set to false (stays on the default.aspx). I still can't figur out what's wrong

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups