0

We have an existing asp.net webform (.net 4) application runnning in production. Recently the users have requested a new page be built, but that page they want only accessible through 1 ip address. Can someone guide me on how to do this? I've seen online ip restrictions at the IIS level, but I don't want to restrict the entire application as it should remain open to all, just that one page should be restricted.

Getting the users' ip I saw I can use the sample from How to get a user's client IP address in ASP.NET?

But is the only way then to restrict it to do a test if returnedIP == "xx.xxx.x.x" or is there a better way to handle this?

Community
  • 1
  • 1
Paritosh
  • 4,243
  • 7
  • 47
  • 80
  • Just in case you think the duplicate is not appropriate, you can tune access rights at the folder level, not only at the application or site level. – Frédéric Hamidi Jun 26 '15 at 13:43
  • @FrédéricHamidi so if i drop the new page into a subfolder, i can restrict that folder's access to 1 ip in IIS, but the rest of the site can remain open? – Paritosh Jun 26 '15 at 13:46
  • 1
    Absolutely. [This answer](http://stackoverflow.com/a/431027/464709) in the duplicate elaborates on that. – Frédéric Hamidi Jun 26 '15 at 13:48
  • @FrédéricHamidi will talk to our network group and see if they can set it up this way. – Paritosh Jun 26 '15 at 14:46

0 Answers0