Website - Restrict display header item to internal users only.

Hi I have a sub header tab control on my product web site.I need to restrict one header item to display only to internal users. I used the [RestrictToInternalIPAddress] decorator in controller class. My question is how can I do that in HTML code? Thanks Rao Gutta

Best Answer

  • mark.maruska
    Answer ✓
    In the **controller**, use the code
    Controller.IsInternalIPAddressUser(this.Request). If you're in an **ascx/aspx (view)**, then turn that into some property on the model (from the controller to the view). If you need to know within the **client-side browser**, then design the server-side code to only respond with the parts needed so there is no client-side logic; since the client-side logic could be hacked by an external source to see the internal items or execute the internal action when that is supposed to only be available for internal users. I hope that helps!

Answers