1

I have a my own custom web server control. I created separate CSS file with CSS classes description for this control. I do not want to add tag to all pages where it is used. So, I believe that there is any way to connect CSS file directly to control. Is there any way to do it?

And what is the best method to add styles to web server custom control?

1 Answer 1

1

This question might work for you. It's for a Custom Control, not a Server Control, but it would only change the method in which CSS stylesheet is dynamically added (not Page_Init(), but maybe Render()?).

That seems to be the only way: a must always be added, though automatically, if an external CSS stylesheet has to be used.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.