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. IP in Text Box

IP in Text Box

Scheduled Pinned Locked Moved ASP.NET
csharphelpvisual-studioquestion
5 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.
  • S Offline
    S Offline
    sjmclean
    wrote on last edited by
    #1

    Hi, I am trying to set up a text box, which as soon as the page loads, the IP of the visitor is shown in a Text Box. The Text Box must also be locked, so that the user can see the IP, but not edited. I am using the following code:

    ">;

    But it is not getting the IP address, instead it is just displaying: <; Any help about how I should tackle this problem? :) (Btw, I'm using C# in Visual Studio)

    K M 2 Replies Last reply
    0
    • S sjmclean

      Hi, I am trying to set up a text box, which as soon as the page loads, the IP of the visitor is shown in a Text Box. The Text Box must also be locked, so that the user can see the IP, but not edited. I am using the following code:

      ">;

      But it is not getting the IP address, instead it is just displaying: <; Any help about how I should tackle this problem? :) (Btw, I'm using C# in Visual Studio)

      K Offline
      K Offline
      keyur satyadev
      wrote on last edited by
      #2

      use proper bindig with text. u missing the method which bind the data with Text Property. make changes as follows. Text='<%#Eval(Request.ServerVariables("remote_addr"))%>' Regards Keyur, "Always Be Happy, Live Life Long"

      S 1 Reply Last reply
      0
      • K keyur satyadev

        use proper bindig with text. u missing the method which bind the data with Text Property. make changes as follows. Text='<%#Eval(Request.ServerVariables("remote_addr"))%>' Regards Keyur, "Always Be Happy, Live Life Long"

        S Offline
        S Offline
        sjmclean
        wrote on last edited by
        #3

        When I did that, it gave me the following error: 'System.Web.HttpRequest.ServerVariables' is a 'property' but is used like a 'method' H:\VisualProgramming\2\guestbook.aspx 41 :sigh:

        K 1 Reply Last reply
        0
        • S sjmclean

          When I did that, it gave me the following error: 'System.Web.HttpRequest.ServerVariables' is a 'property' but is used like a 'method' H:\VisualProgramming\2\guestbook.aspx 41 :sigh:

          K Offline
          K Offline
          keyur satyadev
          wrote on last edited by
          #4

          check it for syntax and make proper concatenation of string. Regards Keyur

          1 Reply Last reply
          0
          • S sjmclean

            Hi, I am trying to set up a text box, which as soon as the page loads, the IP of the visitor is shown in a Text Box. The Text Box must also be locked, so that the user can see the IP, but not edited. I am using the following code:

            ">;

            But it is not getting the IP address, instead it is just displaying: <; Any help about how I should tackle this problem? :) (Btw, I'm using C# in Visual Studio)

            M Offline
            M Offline
            Manas Bhardwaj
            wrote on last edited by
            #5

            http://manasbhardwaj.net/Article/get-the-visitor-ip-address.aspx[^]

            Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.

            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