posts - 41, comments - 200, trackbacks - 0

My Links

News

These postings are provided "AS IS" with no warranties, and confers no rights.
Locations of visitors to this page virtusa corp sharepoint virtusa.com shehan peruma

Tag Cloud

Archives

Post Categories

Display the users IP Address in a Data View Web Part

Quite simple really :)

  1. Open up an existing DVWP or create one.
  2. Right click the DVWP and select ‘Common Data View Tasks’ (or click the little arrow that appears on the top right of the DVWP)
  3. Click the ‘Parameters’ link
  4. In the dialog that opens up click the ‘New Parameter’ button.
  5. Provide a name for the parameter (e.g. IPAddress)
  6. In the ‘Parameter Source’ dropdown select ‘Server Variable’
  7. In the ‘Server Variable Name’ text box enter REMOTE_ADDR
  8. Leave the ‘Default Value’ text box empty
  9. Click OK
  10. Now switch to the code view and go to the place where you want the IPAddress to appear and type the following:
  11. <xsl:value-of select="$IPAddress" />

     

    Thats it! Save and open the page containing the DVWP and it should show you you’re IPAddress. I’ve only been able to test it on the intranet and it works fine. If you want to display values of other server variables you can add more parameters and provide the appropriate variable name.

    Here’s a list of server variables: http://www.w3schools.com/asp/coll_servervariables.asp

     

  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Print | posted on Wednesday, October 14, 2009 9:20 PM | Filed Under [ SharePoint Designer Development ]

Feedback

Gravatar

# re: Display the users IP Address in a Data View Web Part

Thanks so much for this! We've started using Sharepoint for our intranet and I've been searching for a way to to show the users ip address on a help desk ticketing system. Now... Is there any way to grab the ip address and pass it on to a workflow email?

Thanks,

Jeff
11/18/2010 9:23 PM | Jeff Bolin
Post A Comment
Title:
Name:
Email:
Website:
Comment:
Verification:
 
 

Powered by: