Get user IP from HttpContext
using System.Linq; using System.Web; using Microsoft.Win32; public static class Helper { public static string UserIP { get { if (HttpContext.Current == null) return ""; return HttpContext.Current.Request.UserHostAddress; } } }