I've been struggling for hours trying to figure out how to get my Stylesheets into my Webpart. I've come across several resources that claim to explain how it works.
- Using custom css within a Sharepoint webpart as a Embedded Resource is not working, why?
- And some others that essentially say the same thing
The first resource works, but I shouldn't have to manually place a CSS file in a specific folder on each system (Dev, Test, Live). There must be a way to embed the Webpart into the deployment file for the project.
In searching for this, I found the second link I posted. It seems like something I want to do, but I just can't seem to get it to work.
My structure looks like this:
./SOLUTION
> Properties
> References
> ...
> Webpart1
> ...
> Webpart2
> Webpart2.css
> ...
> Styles (A Folder of VS Style 'Module')
> wp2.css
Can someone please guide me on how to include the wp2.css into the SharePoint page only when the webpart is visible on the page, without me having to manually place the CSS file as mentioned in link 1.
Thank you in advance!