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. How to prevent displaying ID= in my URL querystring?

How to prevent displaying ID= in my URL querystring?

Scheduled Pinned Locked Moved ASP.NET
tutorialquestiondiscussion
8 Posts 7 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
    pzn3xq
    wrote on last edited by
    #1

    Any thoughts how to prevent displaying querystring value information...e.g. abc.aspx?userid=103? If someone wants they can type in userid=101 or 102 to display information for the other records by typing in the URL. I've heard folks use GUIDs when passing ID's in URLS. When you see a large value of 889EA536-0B32-3345-B124-F44141C50CB7 would make it complicated to guess the next record. My guess they'd use an INT as the PK, but meanwhile have a GUID column for each user record? Thoughts on that practice? Thanks

    T Y W G 4 Replies Last reply
    0
    • P pzn3xq

      Any thoughts how to prevent displaying querystring value information...e.g. abc.aspx?userid=103? If someone wants they can type in userid=101 or 102 to display information for the other records by typing in the URL. I've heard folks use GUIDs when passing ID's in URLS. When you see a large value of 889EA536-0B32-3345-B124-F44141C50CB7 would make it complicated to guess the next record. My guess they'd use an INT as the PK, but meanwhile have a GUID column for each user record? Thoughts on that practice? Thanks

      T Offline
      T Offline
      ToddHileHoffer
      wrote on last edited by
      #2

      http://www.4guysfromrolla.com/webtech/012000-1.shtml[^]

      I didn't get any requirements for the signature

      B 1 Reply Last reply
      0
      • P pzn3xq

        Any thoughts how to prevent displaying querystring value information...e.g. abc.aspx?userid=103? If someone wants they can type in userid=101 or 102 to display information for the other records by typing in the URL. I've heard folks use GUIDs when passing ID's in URLS. When you see a large value of 889EA536-0B32-3345-B124-F44141C50CB7 would make it complicated to guess the next record. My guess they'd use an INT as the PK, but meanwhile have a GUID column for each user record? Thoughts on that practice? Thanks

        Y Offline
        Y Offline
        Yusuf
        wrote on last edited by
        #3

        If you don't want people to see your querystring, then save it to database and use some ID, preferably GUID. Then based on the id you read the querystring value. another technique is to host your application in iframe, that way only the top level url which houses the iframe will be visible and the user can not see the full url + querystring.

        Yusuf Oh didn't you notice, analogous to square roots, they recently introduced rectangular, circular, and diamond roots to determine the size of the corresponding shapes when given the area. Luc Pattyn[^]

        1 Reply Last reply
        0
        • P pzn3xq

          Any thoughts how to prevent displaying querystring value information...e.g. abc.aspx?userid=103? If someone wants they can type in userid=101 or 102 to display information for the other records by typing in the URL. I've heard folks use GUIDs when passing ID's in URLS. When you see a large value of 889EA536-0B32-3345-B124-F44141C50CB7 would make it complicated to guess the next record. My guess they'd use an INT as the PK, but meanwhile have a GUID column for each user record? Thoughts on that practice? Thanks

          W Offline
          W Offline
          Warp 10
          wrote on last edited by
          #4

          Since you are dealing with only an integer, you could store it in the Session on the source page and then do a response.redirect to the new page and read the session value. SourcePage:

          Protected Sub TransferButton_Click(ByVal sender As Object, ByVal e As EventArgs) Handles TransferButton.Click

          Session("MyId") = MyID
          Response.Redirect("TargetPage.aspx")
          End Sub

          TargetPage.aspx:

          Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
          Dim MyID as Int = 0
          If Me.IsPostBack = False then
          MyID = CInt(Session("MyId"))
          Session("MyId") = Nothing 'Clear value from session after retrieving
          End If

          End Sub

          - Robert Beaubien - Kool Software LLC - Try the New Warp10 Code Generator and Framework at https://www.warp-10.com -

          1 Reply Last reply
          0
          • P pzn3xq

            Any thoughts how to prevent displaying querystring value information...e.g. abc.aspx?userid=103? If someone wants they can type in userid=101 or 102 to display information for the other records by typing in the URL. I've heard folks use GUIDs when passing ID's in URLS. When you see a large value of 889EA536-0B32-3345-B124-F44141C50CB7 would make it complicated to guess the next record. My guess they'd use an INT as the PK, but meanwhile have a GUID column for each user record? Thoughts on that practice? Thanks

            G Offline
            G Offline
            Gaurav Mahajan
            wrote on last edited by
            #5

            you have many options: 1. Not use query string, use post method and retrieve value on next form using previouspage object 2. Use encrypted values in querystring, there are hundreds of different algorithms 3. Use Session object 4. Use Profile 5. Use Application Object too. 6. Use Encrypted Cookies 7. If you want to slow down a little bit use database 8. Also you can use file handling to write value to text or xml file From Gaurav Mahajan Website Developer Amritsar Website: sushilindia.com

            A 1 Reply Last reply
            0
            • G Gaurav Mahajan

              you have many options: 1. Not use query string, use post method and retrieve value on next form using previouspage object 2. Use encrypted values in querystring, there are hundreds of different algorithms 3. Use Session object 4. Use Profile 5. Use Application Object too. 6. Use Encrypted Cookies 7. If you want to slow down a little bit use database 8. Also you can use file handling to write value to text or xml file From Gaurav Mahajan Website Developer Amritsar Website: sushilindia.com

              A Offline
              A Offline
              Armandt__
              wrote on last edited by
              #6

              I'll sugest using session objects, it's the easiest way. oh and if you didn't know , you can place any type of object into a session variable you'll just have to convert it back to the type of object you want when you use it, and another plus , its value can be used on any page.

              W 1 Reply Last reply
              0
              • A Armandt__

                I'll sugest using session objects, it's the easiest way. oh and if you didn't know , you can place any type of object into a session variable you'll just have to convert it back to the type of object you want when you use it, and another plus , its value can be used on any page.

                W Offline
                W Offline
                Warp 10
                wrote on last edited by
                #7

                "oh and if you didn't know , you can place any type of object into a session variable you'll just have to convert it back to the type of object you want when you use it, and another plus , its value can be used on any page." True, but large objects will require more memory in the webserver and will limit scalability of the website.

                - Robert Beaubien - Kool Software LLC - Try the New Warp10 Code Generator and Framework at https://www.warp-10.com -

                1 Reply Last reply
                0
                • T ToddHileHoffer

                  http://www.4guysfromrolla.com/webtech/012000-1.shtml[^]

                  I didn't get any requirements for the signature

                  B Offline
                  B Offline
                  Baran M
                  wrote on last edited by
                  #8

                  Ya encryption is a good way but its been restricted to 2mb in IE and again it depends on the browser you are using.

                  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