Tuesday, October 06, 2009 2:48 PMHello,
Here is my situation. We have a webpart/usercontrol code in our SharePoint publishing site collection. We have test and production invironments, both with multiple app servers, where this code is deployed and worked fine until we made a change in it. Now, when we deploy it in test environment, it works fine, but when we move it to production, some users get below error when they try to access pages with that usercontrol code.
The website declined to show this webpage
Most likely causes:
This website requires you to log in.
We cannot figure out why. We checked the configuration of test and production environments - they look the same. I know I'm giving very little information, but I just wanted to know where to look for a solution. Is it the code? Or, is it some configuration in IIS, SharePoint or Virtual Folder access? What do you think? Any ideas will be much appreaciated.
Tuesday, October 13, 2009 4:04 AM
It seems that you have got HTTP 403 permission problem with your own webpart(with usercontrol).
Here are several action plans for your issue:
1. Where did you deploy your UserControl ? Did it locate in this path
“Driver:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\CONTROLTEMPLATES”?
Please try take ownership of usercontrol(ascx file).
Also, if your webpart is built with dll, please also try take ownership of the bin(Driver:\Inetpub\wwwroot\wss\VirtualDirectories\port) folder on production server.
2. Would you please re-check your code logic. And In your custom web part code, you can use RunWithElevatedPriviledges to void permission issue in code level.
3. Did you use AllWebs["myweb"] property in your code logic? This is a method only for administrator. Instead, you can use SPWeb.GetSubWebsForCurrentUser http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spweb.getsubwebsforcurrentuser.aspx in your code.
Hope this can help.
- Marked As Answer by R.D.M Wednesday, October 14, 2009 4:39 AM
Wednesday, October 14, 2009 4:38 AMHello Aaron,
Thank you for your answer!
We were able to find the cause of my issue. It was because of the authenticated users permission not applied on the Virtual Directories. Your suggestion to take ownership of led us to this, so I must mark your post as an answer. And thanks for the third information, I didn't know about GetSubWebsForCurrentUser property. Very useful.