Big Head Text
Share, progress
View SharePoint Document library Yes, show hierarchy directory, you can click Return hierarchy in SharePoint 2013, the Documnet Library (document library) contains multi-tiered folders, when you go to a folder, return to the specified level (for example, back to the previous layer), Needs to be returned with the browser. Inconvenient to use, and the return of the browser, will cause some problems, not recommended for universal user use. To solve this problem, a directory structure can be implemented by accessing the document library with a URL parameter [RootFolder], which records the path. The [RootFolder] parameter is processed primarily. This is implemented using WebPart. Of course, JavaScript can also be implemented as follows, has entered the multi-layer folder: file path, each node behind can click, jump to the appropriate folder: Codebehind, as follows
protected void Page_Load (object sender, EventArgs e) {string folderurl = this. page.request.querystring["RootFolder"]; if (string. IsNullOrEmpty (FolderUrl) = = False) {String url = this. Page.Request.Url.AbsolutePath; var namevalues = httputility.parsequerystring (this. Page.Request.QueryString.ToString ()); StringBuilder sb = new StringBuilder (); string[] Arrstr = folderurl.split ('/'); int arrlength = Arrstr.length; String Folderctid = this. page.request.querystring["Folderctid"]; String View = this. page.request.querystring["View"]; string tab = this. page.request.querystring["tab"]; String module = this. page.request.querystring["module"]; if (arrstr! = null && arrlength > 0) {for (int i = 0; i < arrlength; i++) {sTring name = Arrstr[i]; if (name. Length > 0) {string rootfoldervalue = folderurl.substring (0, Folderu Rl. LastIndexOf (name)); Rootfoldervalue = rootfoldervalue + name + "/"; Namevalues.set ("RootFolder", Rootfoldervalue); String newurl = URL + "?" + String. Format ("Rootfolder={0}&folderctid={1}&view={2}&tab={3}&module={4}", Httputility.urlencode (Rootfoldervalue), Folderctid, Httputility.urlencode (View), tab, Httputility.urlencode (Modu Le)); if (i = = 1) {name = "root directory"; } sb. Append ("<a href=" + Newurl + ">" + name + "</a>"); if (i! = arrLength-1) { Sb. Append (">>"); }}}} Pathstr = sb. ToString (); } }
View SharePoint Document library Yes, show hierarchy directory, you can click Back level