Using Ted Pattison's screencast as a guide, I'm attempting to create a web part.
This web part is going to be used for the MySites, or any site that we need to have a dynamic listing of the subsites of a site, and links to those sites. I want the user to be able to add the web part without any need for assistance.
Below is code I am attempting to use:
private static XmlNode GetSites(string url, string login, string domain)
{
websService.Webs service = new websService.Webs();
service.PreAuthenticate = false;
service.Credentials = new System.Net.NetworkCredential(login, password, domain);
service.Url = url +
@"/_vti_bin/webs.asmx";XmlNode sites = null;
sites = service.GetWebCollection();
return sites;
}
Every time I attempt to run the code, I get a "Request for the permission of type 'System.Net.WebPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed." Does anyone have any insight as to what exactly my issue is? I'm using the domain/site collection administrator account...