MOSS Forum

 
Home » Forum » MOSS       Ask a questionRSS Feeds

Resolving file paths from a second site collection

  Asked By: Peter Apostle         Date: Dec 20, 2010      Category: MOSS      Views: 2695
 

Hi All,

I'm relatively new to Sharepoint 2007 but I inherited some code that I need to adapt to a new site collection.

The code fills in a navigation line at the top of the page. It requires an xslt page that goes out and reads an xml file.

The offending code is:
XDocument xsl = XDocument.Parse(SPContext.Current.Web.GetFileAsString("/Style%20Library/XSL/topnavigation.xslt"));

The error at the second site collection is that the file is not found. I attribute this to the relative placement of the file in regards to the site collection. If I was on the html side I would use $SPUrl:~sitecollection but I am not sure what to do in the code section.

I may be wrong on the cause but I'm not sure how to verify.

Thanks in advance,

Pete Apostle


Do you know someone who can help? Share a link to this thread on twitter, or facebook.

Tagged:              

 

No Answers Found. Be the First, To Post Answer.

 
Didn't find what you were looking for? Find more on Resolving file paths from a second site collection Or get search suggestion and latest updates.


Your Answer
  • Answer should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].