views:

97

answers:

3

Well fast question is there any way to use a css class in a web user control?

why?

well i have some classes in css that change the layout dramatically so if i want to view the result of the changes i dont want to press f5 and se the page load....

ps im using visual stuido 2008

A: 

yes. just add class attributes to the html elements in your user control or place a div around the whole of the control and give that div a class. it depends how much control over the styling that you need.

darasd
A: 

You can see changes to your css whilst debugging. Just load up your application, edit the css file and then press ctrl f5 to reload the css in you running web app. Only changes to the code need to be recompiled and relaunched.

Emma Middlebrook
once you have the page open, if all you change is the css or an aspx, then you only need to refresh the page from the browser. it's not necessary to load it from visual studio.
darasd
I thought that was what I said :). I guess Petoj just wants to see the css in the dev environment without loading the page though.
Emma Middlebrook
+1  A: 

Hi Petoj,

You want to set the css directly to the usercontrol? Don't think that is a common way to do it, but if anyone else knows more about it...

But you will see the changes on the page which holds the usercontrol if the page has the particular css set in the head section. The changes will automatically be shown on the page.

Hope that helps you Petoj! ;)

Christian80