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. Restriction to access the aspx page directly.

Restriction to access the aspx page directly.

Scheduled Pinned Locked Moved ASP.NET
dockerhelptutorial
4 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
    astrovirgin
    wrote on last edited by
    #1

    Hi, I want to restrict the user to access the page directly through giving the address in the Address Bar of the browser. For Example, I have a page named:

    http://localhost/ISTSMail/Compose.aspx

    . Now I can access this page directly by giving the address in the adress bar but I want to restrict user to access this page only through a particular link not just by giving the address. How it will be possible. Please help.

    J A 2 Replies Last reply
    0
    • A astrovirgin

      Hi, I want to restrict the user to access the page directly through giving the address in the Address Bar of the browser. For Example, I have a page named:

      http://localhost/ISTSMail/Compose.aspx

      . Now I can access this page directly by giving the address in the adress bar but I want to restrict user to access this page only through a particular link not just by giving the address. How it will be possible. Please help.

      J Offline
      J Offline
      J4amieC
      wrote on last edited by
      #2

      Check the Request.UrlReferer property on Compose.aspx and ensure that they came from where you expect them to have come from. Not particularly good security, but does what you asked!

      N 1 Reply Last reply
      0
      • A astrovirgin

        Hi, I want to restrict the user to access the page directly through giving the address in the Address Bar of the browser. For Example, I have a page named:

        http://localhost/ISTSMail/Compose.aspx

        . Now I can access this page directly by giving the address in the adress bar but I want to restrict user to access this page only through a particular link not just by giving the address. How it will be possible. Please help.

        A Offline
        A Offline
        Abhishek Sur
        wrote on last edited by
        #3

        I think you can check your authentication token which you place on login to session. And each page will check if you are authenticated or not. If you are out of session, generate an error and handle it to go to some errorpage from Global.asx For Example : Your page Compose.aspx will check Session["Auth_token"]. If true show the page, otherwise dont.... You can also use Application_BeginRequest event of Global.asax to implement this logic, because it will be called on every page call... :rose:

        Abhishek Sur

        1 Reply Last reply
        0
        • J J4amieC

          Check the Request.UrlReferer property on Compose.aspx and ensure that they came from where you expect them to have come from. Not particularly good security, but does what you asked!

          N Offline
          N Offline
          NikoTanghe
          wrote on last edited by
          #4

          but watch out, the URL referer can be faked rather easy...

          << Nearly all men can stand adversity, but if you want to test a man's character, give him power. >>

          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