Question

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

Was it helpful?

Solution

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

OTHER TIPS

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top