The following resource demonstrates how to detect the client IP in ASP.NET:
http://bytes.com/topic/asp-classic/answers/439176-how-get-clients-ip-address-asp-net
Once you have the IP, load your whitelist from the storage mechanism of your choice, perhaps during an Init event (if in a page), and if the IP fails to match, respond like so (Use HttpContext.Current.Response
if not in a page:
if (!mySafeIpList.Contains(clientIP))
{
Response.Clear()
Response.StatusCode = (int)HttpStatusCode.Unauthorized
Response.End()
}
Or, just simply redirect to a valid page:
Response.Redirect("~/Head-Fake.aspx")
I hope this helps.