문제

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

도움이 되었습니까?

해결책

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

다른 팁

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top