Perhaps it would be a good idea to make the style string an exposed property of 
the web part.  That way it can have default settings but can be tweaked by 
editing the web part in the browser.
From: [email protected] [mailto:[email protected]] On Behalf Of 
Matthew Cosier
Sent: Tuesday, 11 October 2011 10:16 AM
To: 'ozMOSS'
Subject: RE: Add literal content

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
[cid:[email protected]]<http://www.hazaa.com.au/>

Matthew Cosier
CTO / Director
Hazaa Pty Ltd
m: +61 428322904
e: [email protected]<mailto:[email protected]> | w: 
http://www.hazaa.com.au<http://www.hazaa.com.au/>


[cid:[email protected]]


From: [email protected] [mailto:[email protected]] On Behalf Of 
Paul Noone
Sent: Tuesday, 11 October 2011 11:04 AM
To: ozMOSS ([email protected])
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

<<inline: image001.png>>

<<inline: image002.png>>

_______________________________________________
ozmoss mailing list
[email protected]
http://prdlxvm0001.codify.net/mailman/listinfo/ozmoss

Reply via email to