Wednesday, January 7, 2009

Using SPLinkButton ( link with context information)

Scenario:
I wanted to have a link in my master page relative to the site.

Solution:
Sharepoint already have solution out of box. SPLinkButton control understand expression token ( ~site , ~sitecollection ) and was very handy.
Code:

<SharePoint:SPLinkbutton id=idAdminLink Text="View All Site Content" NavigateUrl="~sitecollection/_layouts/viewlsts.aspx" runat="server" CssClass="ms-descriptiontext" />


Happy programming :-)

0 comments: