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 have a custom prop for ContentLink for PageViewerWebPart and the strange thing is that, if i enter i get this below error:

The following file(s) have been blocked by the administrator: /SitePages/ 

Troubleshoot issues with Microsoft SharePoint Foundation. 

if i enter just its work as expected

and here is my custom webpart prop:

        private string _webPartContentLink = null;
        [WebDisplayName("Enter WebPart Content Link")]
        [WebDescription("Enter WebPart Content Link")]
        public string WebPartContentLink 
                if (_webPartContentLink == null)
                    _webPartContentLink = string.Empty;
                return _webPartContentLink;

                    _webPartContentLink = value;

PageViewerWebPart oWebPart = new PageViewerWebPart();
oWebPart.ContentLink = WebPart.WebPartContentLink.ToString();
share|improve this question
Unsure but check your alternate access mappings to see if you have an overly-broad rule. – Erik Noren Sep 2 '11 at 22:45
will you show me the steps how to do that?, i am new to SP – Nick Kahn Sep 2 '11 at 23:25
up vote 0 down vote accepted

According to the MSDN documentation, the ContentLink property can be a Url or file path. You can specify the SourceType property of the webpart so that it knows what to expect for the ContentLink. However, setting the SourceType property will not convert the string in the ContentLink property to a valid url. In fact, the documentation for the PathPattern, the object type that the SourceType takes, states that "you should provide your own validation code for working with the value".

You could include in the property description for the WebPartContentLink how you want the user to enter the information and then check for this in your code.

[WebDescription("Enter WebPart Content Link as http://site Url")]
share|improve this answer

According to the message you receive I think SharePoint treats the link as a relative link. With http it seems absolute and works as you expect.

share|improve this answer

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.