The WebLinks control is a custom web control that renders a list of hyperlinks to web pages from CRM. The control retrieves a web link set record from CRM that consists of a collection of web link records. These web link records are used to render a URL to either an external online resource or a web page from within CRM.

Adding WebLinks to a Page Template

The following control declaration can be added to an ASP.NET page template in the Visual Studio Web Application project.

<crm:WebLinks runat="server" WebLinkSetName="Primary Navigation"
	CssClass="navigation" CurrentSiteMapNodeCssClass="active"
	ShowLinkDescriptions="false" ShowCopy="false"
	ShowTitle="false" ShowImage="false" />

Example Markup

The following is an example of the markup output by the WebLinks control based on the declaration shown above.

<div class="navigation">
   <div class="weblinkset-weblinks xrm-entity xrm-editable-adx_weblinkset">
      <ul>
         <li class="first"><a href="/" class="xrm-weblink  active" title="Home">Home</a></li>
	 <li><a href="/cases/" class="xrm-weblink " title="Cases">Cases</a></li>
	 <li><a href="/events/" class="xrm-weblink " title="Events">Events</a></li>
	 <li><a href="/scheduled-services/" class="xrm-weblink " title="Service">Service</a></li>
	 <li><a href="/forums/" class="xrm-weblink " title="Forums">Forums</a></li>
	 <li class="last"><a href="/contact/" class="xrm-weblink " title="Contact">Contact</a></li>
      </ul>
   </div>
</div>

Control Properties

The WebLinks control has several properties that can be specified to modify the behavior.

NameDescription
WebLinkSetName The name of a web link set to be used to render the hyperlinks for the web pages associated with the links of the set.
ShowTitle A boolean value that indicates whether or not the title of the web link set should be rendered.
ShowCopy A boolean value that indicates whether or not the copy of the web link set should be rendered. 
ShowImage A boolean value that indicates whether or not the image of the links should be rendered.
ShowLinkDescriptions A boolean value that indicates whether or not the descriptions of the links should be rendered. 
Editable A boolean value that indicates whether or not this property value will be inline editable (provided the user has edit permission, and no other properties have been set on this control which disable inline editing support). Default is false.
CurrentSiteMapNodeCssClass A CSS class name value to be added to a weblink if the target node of the weblink is the current site map node.
ParentOfCurrentSiteMapNodeCssClass A CSS class name value to be added to a weblink if the current site map node is a descendant of the target node of the weblink.
DescriptionCssClass A CSS class name value to be added to a weblink's description element.
   
  Related Topics