Ask Learn
Preview
Please sign in to use this experience.
Sign inThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Creates a server-side control that maps to the link HTML element and allows you to specify a cascading style sheet reference in a Web page.
<link
Disabled="Disabled"
EnableViewState="False|True"
Id="string"
Visible="False|True"
OnDataBinding="OnDataBinding event handler"
OnDisposed="OnDisposed event handler"
OnInit="OnInit event handler"
OnLoad="OnLoad event handler"
OnPreRender="OnPreRender event handler"
OnUnload="OnUnload event handler"
runat="server"
/>
The HtmlLink control can be used to declaratively specify a cascading style sheet reference in a Web page.
The following code example demonstrates how to use the HtmlLink control declaratively. The <link> element references a cascading style sheet.
<head runat="server">
<title>HtmlLink Control</title>
<link id="Resource1" href="StyleSheet.css" runat="server" />
</head>
<head runat="server">
<title>HtmlLink Control</title>
<link id="Resource1" href="StyleSheet.css" runat="server" />
</head>
Please sign in to use this experience.
Sign in