I'm trying to use a link button inside of a gridview to redirect to a specific document in sharepoint based on what link they click. the code is as follows:
site = new SPSite("https://c27ipacpndl103w/intranet.manpower...").openweb();
spfolder folder = site.getfolder("https://c27ipacpndl103w/intranet.manpower...");
spfile file = site.getfile("https://c27ipacpndl103w/intranet.manpower...");
response.redirect(file.url);
understand for security reasons I've left out some information but on the spsite I have the base site document library that contains the folder for the file. in spfolder, I have the url for the folder, and spfile is the near exact url for the document (save for a wild card near the end which is built like this:
spfile file = site.getfile("https://c27ipacpndl103w/intranet.manpower..." ... + udyear + "*.pdf");
the "*" is a wild card because the very last part before pdf is indeterminable without a few more hundred lines of code) any assistance with this issue would be greatly appreciated and if any more information is required, please let me know. thank you.
I think it is obvious what the question is but I'll spell it out.
How do I programmatically open a file in sharepoint? I keep getting a url not found error and I've compared the url's and they are exactly the same except the end it puts the "*" in the url.