Try Something Like
href="~/Styles/StyleSheet.css"
where ~/ is Root directory of the application
and add runat="server"
Or just Drag Your css On your control it will automatically create appropriate path
apply stylesheet to web user control
-
05-08-2022 - |
Pergunta
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
Solução
Outras dicas
I think your ResolveUrl is wrong. you can use this in your usercontrol or in that pages which uses this usercontrol :
<link rel="stylesheet" type="text/css" href="../Styles.css" media="screen" />
As far as I know, you can also use the css file
which you have added to your MasterPage
.
So no need to add css file to Web User Control again.
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow