Documentation > Services API > HyperLink > ToString(LinkOutputType)

ToString

ToString() override for HyperLink class.

public System.String ToString(LinkOutputType)


Returns

HTML image link

Parameters

NameDescriptionType
linkOutputType Enumerated type for outputing an image link CrownPeak.CMSAPI.Services.ServicesOutput+LinkOutputType

Code Example

C#

Sample:

            HyperLink imgOutputLink = new HyperLink(asset, "Imagelink");
            Out.WriteLine( imgOutputLink.ToString(LinkOutputType.ImageLink) );
            /*returns and outputs:
            <a href="www.google.com" target="_blank"><img src="_Assets/images/googleLogo.jpg" alt="alt text" border="0"/></a> 
            assuming imageLinkOption is enabled in ServicesInput.ShowHyperLink and external link was used in the form.*/
            

Connect with Crownpeak