I think it might be worth taking a step back and looking at the reasons why you'd want to do this type of thing. I hear bells going off in my head telling me that this isn't a good idea.
I can understand that you want your styles and scripts to live with your web part, but ignoring the fact that I know nothing of the background of why you're trying to do this, I'd suggest this should live in a masterpage - whether that's deployed with the feature which deploys the web parts, or otherwise. If you need it to be conditional, then I'd suggest that perhaps it's a custom control which sits within the masterpage which manages that logic. Other people who are implementing branding or styling on that page, then have the concern that by dropping on this web part, their styles may be overridden (and it can cause havoc, and a lot of head scratching). I'd be definitely looking at the reasons why the styling needs to be part of the web part (and the scripts), and see if you can abstract it to a higher level in the application. Cheers, Matt <http://www.hazaa.com.au/> Matthew Cosier CTO / Director Hazaa Pty Ltd m: +61 428322904 e: matt <mailto:m...@hazaa.com.au> @hazaa.com.au | w: <http://www.hazaa.com.au/> http://www.hazaa.com.au Description: cid:image002.png@01CC1483.033B48F0 From: ozmoss-boun...@ozmoss.com [mailto:ozmoss-boun...@ozmoss.com] On Behalf Of Paul Noone Sent: Tuesday, 11 October 2011 11:04 AM To: ozMOSS (ozmoss@ozmoss.com) Subject: Add literal content Hi all, Silly question but what is the best method of adding a literal string to a deployable web part? I want to include some script references and styles before the web part is rendered. I've constructed the string using StringBuilder and had added it as a control to CreatedChildControls. This works for most content but my CSS styles get converted like so. <style type="text/css">CSS Stylesheet</style> What's the best way to add this type of content? Kind regards, Paul
<<image003.png>>
<<image004.png>>
_______________________________________________ ozmoss mailing list ozmoss@ozmoss.com http://prdlxvm0001.codify.net/mailman/listinfo/ozmoss