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. IIS - Allow access only to login.aspx

IIS - Allow access only to login.aspx

Scheduled Pinned Locked Moved Web Development
questiondatabasesql-serversysadminwindows-admin
3 Posts 3 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.
  • P Offline
    P Offline
    piticcotoc
    wrote on last edited by
    #1

    Hello, I'm developing an webapp that uses sql authentification to am mssql server. I've created the login page which redirects to main page if succesful login. How can i restrict access to every other page in IIS? Ex: if i tyoe http://localhost/rms it opens the login.aspx page if i type http://localhost/main.aspx it opens the main page without auth and i don't want to

    A A 2 Replies Last reply
    0
    • P piticcotoc

      Hello, I'm developing an webapp that uses sql authentification to am mssql server. I've created the login page which redirects to main page if succesful login. How can i restrict access to every other page in IIS? Ex: if i tyoe http://localhost/rms it opens the login.aspx page if i type http://localhost/main.aspx it opens the main page without auth and i don't want to

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

      There are lots of things you can do. But the simplest one is Create a BasePage which you will inherit from Page public class BasePage : Page in the page_load Check a session variable. Say if(Session["IsAuthenticated"] = true)... Now inherit every page from BasePage except Login page. If login is successful set Session["IsAuthenticated"] = true; Hope this help you. :rose:

      Abhishek Sur


      My Latest Articles **Create CLR objects in SQL Server 2005 C# Uncommon Keywords Read/Write Excel using OleDB

      **Don't forget to click "Good Answer" if you like to.

      1 Reply Last reply
      0
      • P piticcotoc

        Hello, I'm developing an webapp that uses sql authentification to am mssql server. I've created the login page which redirects to main page if succesful login. How can i restrict access to every other page in IIS? Ex: if i tyoe http://localhost/rms it opens the login.aspx page if i type http://localhost/main.aspx it opens the main page without auth and i don't want to

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

        As Abhishek suggested, you need to maintin the session. When users loogs in, store user info in session variable, on every page load check session is null or not, if null , redirect to Login page. You have to clear the session on Log off.

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

        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