0

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

Bhasker Vengala
  • 103
  • 5
  • 19

3 Answers3

2

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

Vishal Pandey
  • 460
  • 1
  • 4
  • 15
0

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" />
Masoumeh Karvar
  • 791
  • 1
  • 14
  • 32
0

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.

Bengi Besçeli
  • 3,638
  • 12
  • 53
  • 87