Updated: 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.
End Update
using (SPSite site = new SPSite("http://servername/sites/test/"))
{
PageViewerWebPart pvwp = new PageViewerWebPart();
pvwp.Title = "My Page Viewer Web Part";
pvwp.ContentLink = "http://www.cnn.com";
this.Controls.Add(pvwp);
}
The following file(s) have been blocked by the administrator: /SitePages/.