I want to apply styles
to one webusercontrol
I have tried with
<link rel="Stylesheet" type="text/css" href="<%=ResolveUrl("~/Styles/ascxStyles.css") %>" />
but i'm not able to apply styles to user control.
Thanks in advance
I want to apply styles
to one webusercontrol
I have tried with
<link rel="Stylesheet" type="text/css" href="<%=ResolveUrl("~/Styles/ascxStyles.css") %>" />
but i'm not able to apply styles to user control.
Thanks in advance
尝试类似 href="~/Styles/StyleSheet.css" 其中 ~/ 是应用程序的根目录并添加 runat="server"
或者只是将您的 css 在您的控件上拖动它会自动创建适当的路径
我认为您的 ResolveUrl 是错误的。您可以在您的用户控件或使用此用户控件的页面中使用它:
<link rel="stylesheet" type="text/css" href="../Styles.css" media="screen" />
据我所知,您还可以使用
已添加到MasterPage
.
因此无需再次将 css 文件添加到 Web 用户控件。