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. 2010 sitemap

2010 sitemap

Scheduled Pinned Locked Moved ASP.NET
csharpwindows-admintutorialquestionworkspace
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.
  • C Offline
    C Offline
    classy_dog
    wrote on last edited by
    #1

    I would like to know how to modify a sitemap and/or change some C# 2010 code to not allow certain users access to this new web page. I am basically adding a new web form page to an existing C#.net 2010 application. I am adding some web pages that will be displayed from the main page. Right now the contractor that setup this application, had 'shells' for the modules that will be added at different points. When the existing web page displays that I am going to add to this website, the page is pointed to a 'mapped url' that displays 'the site is under construction'. In the web.config file, there is a sitemap that says who access the web page. I tried to give the sitemap a user role that does not exist in the active directory and the web page still displayed. Thus can you tell me and/or point me to a reference on how to modify the sitemap and/or add some code to the application so only users under a certain role have access this this new web page?

    J 1 Reply Last reply
    0
    • C classy_dog

      I would like to know how to modify a sitemap and/or change some C# 2010 code to not allow certain users access to this new web page. I am basically adding a new web form page to an existing C#.net 2010 application. I am adding some web pages that will be displayed from the main page. Right now the contractor that setup this application, had 'shells' for the modules that will be added at different points. When the existing web page displays that I am going to add to this website, the page is pointed to a 'mapped url' that displays 'the site is under construction'. In the web.config file, there is a sitemap that says who access the web page. I tried to give the sitemap a user role that does not exist in the active directory and the web page still displayed. Thus can you tell me and/or point me to a reference on how to modify the sitemap and/or add some code to the application so only users under a certain role have access this this new web page?

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

      To the best of my knowledge, the sitemap.xml is just a xml file that contains sitemap nodes. You can't control access to files and folders through it. You have to write code for each page, to control access. So let's say you have 5 levels of security

      On login, you would add
      Context.Session.Add("security", 5)

      And in the page, on page.init, your code would say

      If Not Context.Session("security") > 3 Then
      Context.response.redirect("security.aspx")
      End If

      J 1 Reply Last reply
      0
      • J jkirkerx

        To the best of my knowledge, the sitemap.xml is just a xml file that contains sitemap nodes. You can't control access to files and folders through it. You have to write code for each page, to control access. So let's say you have 5 levels of security

        On login, you would add
        Context.Session.Add("security", 5)

        And in the page, on page.init, your code would say

        If Not Context.Session("security") > 3 Then
        Context.response.redirect("security.aspx")
        End If

        J Offline
        J Offline
        JMummery
        wrote on last edited by
        #3

        I agree with this. You cannot control security using xml but you can check variables and then redirect accordingly. Another option would be to use a database and check the users security level and that will determine what pages they can view.

        Kind Regards Julian Mummery


        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