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. securing web pages using forms authentication

securing web pages using forms authentication

Scheduled Pinned Locked Moved ASP.NET
helpasp-netsecuritytutorialquestion
3 Posts 2 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
    Pradip Kishore
    wrote on last edited by
    #1

    i have two web pages(login.aspx and account.aspx)i want to secure my account.aspx from unauthorised access.i used forms authentication as modified the web.config as follows: in the login button click event the codes are as follows: if username.text="pradip" and password.text="pkc" then FormsAuthentication.RedirectFromLoginPage(username.text,false) else labelmsg.text="invalid user name or password" now my problem is that when ever i am directly accesing accout.aspx(without logging in),it is not automatically redirecting to login.aspx.. suoopse i have 10 webforms in my project out of which i want to make 5 web forms secure so that if any unauthorised user wants to access them,they will be automatically redirected to login.aspx ..how can i do this(i think that i have to check the cookie value "AuthCookie" in the page load event of the secure pages..but i dont know how to do it.. if i write request.cookies("AuthCookie").value is nothing then response.redirect("login.aspx").. in the page load events of the secure pages then also it is not redirecting to login.aspx..plz help me out this..its urgent .. thanks in advance

    pradip kishore

    P 1 Reply Last reply
    0
    • P Pradip Kishore

      i have two web pages(login.aspx and account.aspx)i want to secure my account.aspx from unauthorised access.i used forms authentication as modified the web.config as follows: in the login button click event the codes are as follows: if username.text="pradip" and password.text="pkc" then FormsAuthentication.RedirectFromLoginPage(username.text,false) else labelmsg.text="invalid user name or password" now my problem is that when ever i am directly accesing accout.aspx(without logging in),it is not automatically redirecting to login.aspx.. suoopse i have 10 webforms in my project out of which i want to make 5 web forms secure so that if any unauthorised user wants to access them,they will be automatically redirected to login.aspx ..how can i do this(i think that i have to check the cookie value "AuthCookie" in the page load event of the secure pages..but i dont know how to do it.. if i write request.cookies("AuthCookie").value is nothing then response.redirect("login.aspx").. in the page load events of the secure pages then also it is not redirecting to login.aspx..plz help me out this..its urgent .. thanks in advance

      pradip kishore

      P Offline
      P Offline
      payback
      wrote on last edited by
      #2

      put all the pages which you wanna have in 'Logged in ' area in configuration section of web.config as follows.

      P 1 Reply Last reply
      0
      • P payback

        put all the pages which you wanna have in 'Logged in ' area in configuration section of web.config as follows.

        P Offline
        P Offline
        Pradip Kishore
        wrote on last edited by
        #3

        hi thanks for your response do you mean that i have to add as many location path in the web.config file as the no of secure pages i have... can you please show me how to write it for 2 web pages(account.aspx,transaction.aspx) in the web.config file thanks in advance

        i m pradip kishore from india,working in vb.net & asp.net

        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