SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to make a authentication WebPart. For this, i used tghios tutorial:

But this line doesn't work and return me a Null: SPIisSettings settings = webApp.IisSettings[SPContext.Current.Site.Zone];

I don't understand why?

May be somebody Can Help me.


share|improve this question
Can you try using ULS viewer and find any related errors – Mathematics Sep 7 '12 at 8:19
also can you check if your getting anything for "SPContext.Current.Site.Zone" or if its null – Mathematics Sep 7 '12 at 11:19

try this instead, might help

 SPIisSettings iisSettings = this.webApp.IisSettings[];

OR use this one


instead of ""

share|improve this answer
I've got an erreor message: My Webpart doesn't contain a defintion for Zone. I miss something? – Julio Sep 7 '12 at 8:38
Zone is just part of page where you add your webpart to, so don't think that is the problem – Mathematics Sep 7 '12 at 8:52
Sorry I don't have a zone property on my object this. – Julio Sep 7 '12 at 9:34
sorry I was confused so ignore my 1st comment, I guess you need to create a new zone maybe, check this link out – Mathematics Sep 7 '12 at 10:02

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.