barcode rendering framework c# example CUSTOMIZING SITE NAVIGATION in Font

Maker PDF-417 2d barcode in Font CUSTOMIZING SITE NAVIGATION

CHAPTER 7 CUSTOMIZING SITE NAVIGATION
PDF 417 Encoder In None
Using Barcode generation for Font Control to generate, create PDF417 image in Font applications.
www.OnBarcode.com
Barcode Drawer In None
Using Barcode encoder for Font Control to generate, create Barcode image in Font applications.
www.OnBarcode.com
'Only include lists that the current user is authorized to view web.Lists.ListsForCurrentUser = True 'Iterate through the list items, adding to the DataTable those 'that are flagged as visible and to be displayed on the Quick Launch For Each list In web.Lists If list.Hidden = False And list.OnQuickLaunch = True Then dr = dt.NewRow dr("Type") = list.BaseType dr("Title") = list.Title dr("Url") = list.DefaultViewUrl dr("ImageUrl") = list.ImageUrl dr("Description") = list.Description dr("Template") = list.BaseTemplate dt.Rows.Add(dr) End If Next The last section of code (see Listing 7-10) creates a new XML web control, assigns the XML from DataTable to it, transforms the XML using the supplied XSLT, and renders the resulting HTML to the output stream. Listing 7-10. Rendering the Output to the Page 'Display the list on the page. Dim xml As New Web.UI.WebControls.Xml Dim ds As New DataSet("MyLists") ds.Tables.Add(dt) xml.DocumentContent = ds.GetXml xml.TransformSource = XSLTSource xml.RenderControl(output) End Sub
EAN128 Encoder In None
Using Barcode drawer for Font Control to generate, create UCC.EAN - 128 image in Font applications.
www.OnBarcode.com
Quick Response Code Encoder In None
Using Barcode creator for Font Control to generate, create QR image in Font applications.
www.OnBarcode.com
Note The preceding code provides an important improvement over the stock Quick Launch routine; it only displays those lists that the user is authorized to view. The stock Quick Launch, on the other hand, displays any lists that are flagged for inclusion on the Quick Launch menu, even if the end user is not authorized to view them. It is only when the user clicks a link that SharePoint verifies the user s permissions and, for unauthorized users, displays a login dialog box requesting that they provide a new user name and password.
PDF 417 Printer In None
Using Barcode drawer for Font Control to generate, create PDF-417 2d barcode image in Font applications.
www.OnBarcode.com
Create UPC-A Supplement 5 In None
Using Barcode maker for Font Control to generate, create GS1 - 12 image in Font applications.
www.OnBarcode.com
Figure 7-1 shows the unformatted data retrieved from the SPWeb object displayed in a DataGrid. Note that the Url column is relative to the current site (in this example http://localhost). This data provides the raw material to create a nicely formatted list of lists from which your users can navigate to the list of their choice.
Creating Code128 In None
Using Barcode generation for Font Control to generate, create Code 128 Code Set C image in Font applications.
www.OnBarcode.com
Making RoyalMail4SCC In None
Using Barcode creation for Font Control to generate, create Royal Mail Barcode image in Font applications.
www.OnBarcode.com
CHAPTER 7 CUSTOMIZING SITE NAVIGATION
Decode PDF 417 In Visual C#.NET
Using Barcode decoder for VS .NET Control to read, scan read, scan image in .NET applications.
www.OnBarcode.com
PDF-417 2d Barcode Generation In None
Using Barcode maker for Word Control to generate, create PDF 417 image in Microsoft Word applications.
www.OnBarcode.com
Figure 7-1. Data used by MyQuickLaunch
Generating Barcode In .NET Framework
Using Barcode drawer for VS .NET Control to generate, create Barcode image in Visual Studio .NET applications.
www.OnBarcode.com
Print PDF417 In None
Using Barcode creator for Microsoft Excel Control to generate, create PDF417 image in Excel applications.
www.OnBarcode.com
Creating an XSLT to Format MyQuickLaunch
Drawing Matrix Barcode In Visual Studio .NET
Using Barcode printer for .NET framework Control to generate, create 2D Barcode image in .NET framework applications.
www.OnBarcode.com
Recognize USS Code 39 In None
Using Barcode reader for Software Control to read, scan read, scan image in Software applications.
www.OnBarcode.com
After we have our list of lists, it s easy to format it using XSLT. The variety of output formats that can be produced for this web control is limited only by your requirements and imagination. Listing 7-11 shows the XSLT document that produces the output, as shown in Figure 7-2. The version of the MyQuickLaunch shown provides collapsible sections for each list type, and, as noted earlier, shows only those lists the end user is authorized to view.
Reading Barcode In Visual Studio .NET
Using Barcode Control SDK for ASP.NET Control to generate, create, read, scan barcode image in ASP.NET applications.
www.OnBarcode.com
GS1 - 13 Printer In None
Using Barcode maker for Microsoft Excel Control to generate, create EAN-13 image in Office Excel applications.
www.OnBarcode.com
Figure 7-2. Sample MyQuickLaunch format The XSLT to produce the preceding layout highlights some of the more interesting XSLT formatting capabilities. The first major block after the standard <xsl> elements is a bit of JavaScript that will be inserted verbatim into the rendered document. This function allows the user to click the +/ icon on the left of the heading to expand or collapse that section.
Code 128 Code Set C Printer In None
Using Barcode printer for Microsoft Word Control to generate, create ANSI/AIM Code 128 image in Word applications.
www.OnBarcode.com
European Article Number 13 Generator In Objective-C
Using Barcode drawer for iPad Control to generate, create EAN13 image in iPad applications.
www.OnBarcode.com
CHAPTER 7 CUSTOMIZING SITE NAVIGATION
European Article Number 13 Decoder In Visual C#.NET
Using Barcode decoder for .NET Control to read, scan read, scan image in Visual Studio .NET applications.
www.OnBarcode.com
Painting Barcode In VS .NET
Using Barcode maker for Reporting Service Control to generate, create Barcode image in Reporting Service applications.
www.OnBarcode.com
Listing 7-11. Sample XSLT to Format MyQuickLaunch < xml version='1.0' > <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="html"/> <xsl:template match="/"> ... Listing 7-12 shows the JavaScript helper function to show/hide the detail for a given menu section. Listing 7-12. XSLT JavaScript to Show/Hide Details ... <script language="javascript"> function toggleRssItem(theParentDiv, resourcePath) { // get the div id var parentId = theParentDiv.id; // get the child div var childDiv = document.getElementById(parentId + "__child"); // toggle the display if (theParentDiv.src.indexOf("collapsePlus.gif") > -1) { theParentDiv.src = resourcePath + "/collapseMinus.gif"; childDiv.style.display = ""; } else { theParentDiv.src = resourcePath + "/collapsePlus.gif"; childDiv.style.display = "none"; } } </script> ... Using subtemplates simplified and reduced the size of the template. The <xsl:with-param> statement, as shown in Listing 7-13, allows the calling template to pass parameters to the subtemplate. Listing 7-13. XSLT to Call Subtemplate ... <!-- Display all Contacts --> <xsl:call-template name="sectionBody"> <xsl:with-param name="sectionTitle" select="'Contact Lists'"/> <xsl:with-param name="template" select="'Contacts'"/> </xsl:call-template>
CHAPTER 7 CUSTOMIZING SITE NAVIGATION
<!-- Display all Contacts --> <xsl:call-template name="sectionBody"> <xsl:with-param name="sectionTitle" select="'Document Libraries'"/> <xsl:with-param name="template" select="'DocumentLibrary'"/> </xsl:call-template> <!-- Display all Event Lists --> <xsl:call-template name="sectionBody"> <xsl:with-param name="sectionTitle" select="'Event Lists'"/> <xsl:with-param name="template" select="'Events'"/> </xsl:call-template> <!-- Display all Task Lists --> <xsl:call-template name="sectionBody"> <xsl:with-param name="sectionTitle" select="'Task Lists'"/> <xsl:with-param name="template" select="'Tasks'"/> </xsl:call-template> </xsl:template> ... The sectionBody template, shown in Listing 7-14, produces the section heading and all menu links for the section. Note the <div> tag, which is hidden by default using the style= "display: none;" clause. The onclick="toggleRssItem(this,'/_layouts/images');" clause of the heading enables users to toggle the visibility of the detail section by clicking the +/ icon. Listing 7-14. Subtemplate That Formats the Section Data ... <xsl:template name="sectionBody"> <xsl:param name="sectionTitle"/> <xsl:param name="template"/> <table width="90%" cellpadding="0" cellspacing="0"> <tr> <td vAlign="top" align="center" width="3%" class="ms-WPBody" valign="middle"> <img id="{$template}" onclick="toggleRssItem(this,'/_layouts/images');" alt="Click here to expand/collapse item detail" src="/_layouts/images/collapsePlus.gif" border="0"/> </td> <td class="ms-WPBody"> <strong><xsl:value-of select="$sectionTitle"/></strong> <br/> </td> </tr> </table>
Copyright © OnBarcode.com . All rights reserved.