ASP.NET load Stylesheet dynamically with no duplicate(blog.ysatech.com)

submitted by bryiantanbryiantan(115) 2 years, 8 months ago

I have an ASP.NET WebUserControl that requires a CSS Stylesheet to display correctly. My goal is to not include the CSS stylesheet in any of my Page or Masterpage whenever I consume the WebUserControl. All I want to do is just drag and drop one or more of the WebUserControl on to my page and I'm good to go. I can solve this maze by loading the CSS stylesheet in my user WebUserControl dynamically. But it will load duplicates CSS on my page if I have more than one of the identical WebUserControl. If you happen to come across into this kind of situation, here is the solution on how to prevent loading duplicate CSS stylesheet on your page. It works for me, comments are welcome.

add a comment |category: |Views: 27

tags: another

new Add a live kick counter to your blog >> liveImage

You can even customize the image by choosing your own colors, and then clicking the button below to update the preview and the html code:

  • "Kick It" text
  • "Kick It" background
  • kick count text
  • kick count background
  • border

Simply copy and paste this HTML into your blog post.


Users who kicked this story:
Comments:

No comments so far

information Login or create an account to comment on this story