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. asp.net is not redirecting a page to proper login.aspx page for authentication.

asp.net is not redirecting a page to proper login.aspx page for authentication.

Scheduled Pinned Locked Moved ASP.NET
csharpasp-netsysadminsecurityhelp
7 Posts 4 Posters 3 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.
  • C Offline
    C Offline
    coolsatty
    wrote on last edited by
    #1

    In my Web.config file,authentication mode is "Form" and login url is "Login.aspx" which is in root directory.when i am calling a page which is in sub directory,then my page should automatically redirect to "Login.aspx" for authentication.but my problem is that instead of redirecting the page to "login.aspx" in root directory it searches in the same sub directory hence it does not get a file. But when i am working offline ie on local PC,i don't get this problem.when i have uploaded this project on server i face this problem. Thank u.

    coolsatty

    E J F 3 Replies Last reply
    0
    • C coolsatty

      In my Web.config file,authentication mode is "Form" and login url is "Login.aspx" which is in root directory.when i am calling a page which is in sub directory,then my page should automatically redirect to "Login.aspx" for authentication.but my problem is that instead of redirecting the page to "login.aspx" in root directory it searches in the same sub directory hence it does not get a file. But when i am working offline ie on local PC,i don't get this problem.when i have uploaded this project on server i face this problem. Thank u.

      coolsatty

      E Offline
      E Offline
      eyeseetee
      wrote on last edited by
      #2

      I think you may need to specify the entire path of where your login.aspx page is rather then just ~/login.aspx

      C 1 Reply Last reply
      0
      • C coolsatty

        In my Web.config file,authentication mode is "Form" and login url is "Login.aspx" which is in root directory.when i am calling a page which is in sub directory,then my page should automatically redirect to "Login.aspx" for authentication.but my problem is that instead of redirecting the page to "login.aspx" in root directory it searches in the same sub directory hence it does not get a file. But when i am working offline ie on local PC,i don't get this problem.when i have uploaded this project on server i face this problem. Thank u.

        coolsatty

        J Offline
        J Offline
        Jesse Squire
        wrote on last edited by
        #3

        I believe your problem is a result of your file path being relative. Ensure that your configuration references the file from the website root. In your case, ~/login.aspx should work. Hope that helps. :)

        --Jesse

        "... the internet's just a big porn library with some useful articles stuck in." - Rob Rodi

        1 Reply Last reply
        0
        • C coolsatty

          In my Web.config file,authentication mode is "Form" and login url is "Login.aspx" which is in root directory.when i am calling a page which is in sub directory,then my page should automatically redirect to "Login.aspx" for authentication.but my problem is that instead of redirecting the page to "login.aspx" in root directory it searches in the same sub directory hence it does not get a file. But when i am working offline ie on local PC,i don't get this problem.when i have uploaded this project on server i face this problem. Thank u.

          coolsatty

          F Offline
          F Offline
          farazsk11
          wrote on last edited by
          #4

          Hi, Try "~/Login.aspx".

          Faraz Shah Khan MCP, MCAD.Net Blog

          C 1 Reply Last reply
          0
          • F farazsk11

            Hi, Try "~/Login.aspx".

            Faraz Shah Khan MCP, MCAD.Net Blog

            C Offline
            C Offline
            coolsatty
            wrote on last edited by
            #5

            tried it but still the same problem.

            coolsatty

            F 1 Reply Last reply
            0
            • E eyeseetee

              I think you may need to specify the entire path of where your login.aspx page is rather then just ~/login.aspx

              C Offline
              C Offline
              coolsatty
              wrote on last edited by
              #6

              I tried putting entire path but it still searches in sub directory.Is there any settings in IIS because here in my PC its working fine but at server(handled by third party)side i am getting this problem.

              coolsatty

              1 Reply Last reply
              0
              • C coolsatty

                tried it but still the same problem.

                coolsatty

                F Offline
                F Offline
                farazsk11
                wrote on last edited by
                #7

                Hi, this is from my project <authentication mode="Forms"> <forms name=".ASPXFORUM" loginUrl="~/index.aspx" protection="All" timeout="180" path="/"/> </authentication> and it works absolutely fine with me.

                Faraz Shah Khan MCP, MCAD.Net Blog

                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