Skip to main content
add link to the msdn page for the suggested method, formatted code
Source Link

You can use the SPWeb GetFile method to retrive the SPFile located at a specified url. Try something like this:

SPFile file = SPContext.Current.Web.GetFile(string.Format("{0}/{1}", x, y));

SPFile file = SPContext.Current.Web.GetFile(string.Format("{0}/{1}", x, y));

Try:

SPFile file = SPContext.Current.Web.GetFile(string.Format("{0}/{1}", x, y));

You can use the SPWeb GetFile method to retrive the SPFile located at a specified url. Try something like this:

SPFile file = SPContext.Current.Web.GetFile(string.Format("{0}/{1}", x, y));
Source Link
Rich Bennema
  • 1.1k
  • 6
  • 18

Try:

SPFile file = SPContext.Current.Web.GetFile(string.Format("{0}/{1}", x, y));