asp.net c# ip address lost after postback?

Posted by Mark on Stack Overflow See other posts from Stack Overflow or by Mark
Published on 2010-03-08T17:48:22Z Indexed on 2010/03/08 17:51 UTC
Read the original article Hit count: 263

Filed under:
|
|
|

Hi all,

One of my functions in a class is called GetIpAddress() which returns the following string: System.Web.HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"]

This all works well in regular page loads and gets my ip address, but when i for example let a user place a comment, then the ip address is lost after postback and i get an empty string returned.

Am I missing something here maybe?

Kind regards, Mark

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about c#