Re: Add literal content

2011-10-10 Thread Joseph Clark
Hey Paul,

You can use the
System.Web.UI.LiteralControlhttp://msdn.microsoft.com/en-us/library/system.web.ui.literalcontrol.aspxto
include raw HTML into an
ASP.NET page.

To include arbitrary in-line CSS styles into the page, you could
alternatively consider using the ClientScriptManager object on the current
ASP.NET Page or the CssRegistration class in the SharePoint API.

Cheers,
Joe.






On Tue, Oct 11, 2011 at 11:03 AM, Paul Noone 
paul.no...@ceosyd.catholic.edu.au wrote:

 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

 ** **

 ___
 ozmoss mailing list
 ozmoss@ozmoss.com
 http://prdlxvm0001.codify.net/mailman/listinfo/ozmoss


___
ozmoss mailing list
ozmoss@ozmoss.com
http://prdlxvm0001.codify.net/mailman/listinfo/ozmoss


RE: Add literal content

2011-10-10 Thread Matthew Cosier
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/cssCSS Stylesheet/style

What's the best way to add this type of content?

 

Kind regards,

Paul

 

image003.pngimage004.png___
ozmoss mailing list
ozmoss@ozmoss.com
http://prdlxvm0001.codify.net/mailman/listinfo/ozmoss


RE: Add literal content

2011-10-10 Thread Mark Daunt
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: ozmoss-boun...@ozmoss.com [mailto:ozmoss-boun...@ozmoss.com] 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:image001.png@01CC87FF.E8A3F050]http://www.hazaa.com.au/

Matthew Cosier
CTO / Director
Hazaa Pty Ltd
m: +61 428322904
e: m...@hazaa.com.aumailto:m...@hazaa.com.au | w: 
http://www.hazaa.com.auhttp://www.hazaa.com.au/


[cid:image002.png@01CC87FF.E8A3F050]


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/cssCSS Stylesheet/style
What's the best way to add this type of content?

Kind regards,

Paul

inline: image001.pnginline: image002.png___
ozmoss mailing list
ozmoss@ozmoss.com
http://prdlxvm0001.codify.net/mailman/listinfo/ozmoss


RE: Add literal content

2011-10-10 Thread Paul Noone
Hi Matt,
A bit of background. I'm attempting to deploy a DataFormWebPart for LightBox 
rendering of a specified Image library. The CSS and the script refs are 
specific to the rendering and functionality of the gallery and have no impact 
on anything else. There's also a dependency on my jQuery feature to avoid 
conflicts.
The web part takes the List Name as a parameter for the datasource and the XML 
transformation is handled by pre-setting the XSL link value.
[cid:image003.png@01CC8809.9B4D0120]
Now, if only I could get past these errors. :( Think I've bitten off more than 
I can chew.
Does anyone know a good resource for deploying DFWPs??
SPDataSourceView.ExecuteSelect() - selectArguments: IsEmpty=True, 
MaximumRows=0, RetrieveTotalRowCount=False, SortExpression=, StartRowIndex=0, 
TotalRowCount=-1
SPDataSourceView.ExecuteSelect() - formattedQuery =
Unknown SPRequest error occurred. More information: 0x80070002
Error while executing web part: System.ArgumentNullException: Value cannot be 
null. Parameter name: s
 at System.IO.StringReader..ctor(String s)
 at 
Microsoft.SharePoint.WebPartPages.DataFormWebPart.GetXslCompiledTransform()
 at 
Microsoft.SharePoint.WebPartPages.DataFormWebPart.PrepareAndPerformTransform()
Regards,

Paul

--
Online Developer/SharePoint Administrator,
ICT Infrastructure Team
CEO Sydney

From: ozmoss-boun...@ozmoss.com [mailto:ozmoss-boun...@ozmoss.com] On Behalf Of 
Matthew Cosier
Sent: Tuesday, 11 October 2011 11: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:image001.png@01CC8808.D41DCB20]http://www.hazaa.com.au/

Matthew Cosier
CTO / Director
Hazaa Pty Ltd
m: +61 428322904
e: m...@hazaa.com.aumailto:m...@hazaa.com.au | w: 
http://www.hazaa.com.auhttp://www.hazaa.com.au/


[cid:image002.png@01CC8808.D41DCB20]


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/cssCSS Stylesheet/style
What's the best way to add this type of content?

Kind regards,

Paul

inline: image001.pnginline: image002.pnginline: image003.png___
ozmoss mailing list
ozmoss@ozmoss.com
http://prdlxvm0001.codify.net/mailman/listinfo/ozmoss