For number 2:  it is C# therefore it is 'true' not 'True'.

Regards,

Paul Turner
Senior Solutions Specialist

M: 0412 748 168 P: 08 8238 0912 F: 08 8234 5966
A: 66 Henley Beach Road, Mile End SA 5031
E: [email protected]<mailto:[email protected]>  W: www.dws.com.au
[cid:[email protected]]
ADVANCED BUSINESS SOLUTIONS LTD

This email and any files transmitted with it are confidential and are only for 
the use of the person to whom they are addressed. If you are not the intended 
recipient you have received this email in error and are requested to delete it 
immediately. Any opinion expressed in this e-mail may not necessarily be that 
of DWS Pty Ltd.
Please consider the environment before printing this email.

From: [email protected] [mailto:[email protected]] On Behalf Of 
Sezai Komur
Sent: Tuesday, 16 March 2010 12:01 PM
To: ozMOSS
Subject: Re: Code support

You could try this instead.

if(SPContext.Current.ListItem.GetFormattedValue("NEALS")=="Yes")
Sezai.
On Tue, Mar 16, 2010 at 9:24 AM, Paul Noone 
<[email protected]<mailto:[email protected]>> 
wrote:
Getting closer but more errors have come as a result. :)

Error   1        The as operator must be used with a reference type or nullable 
type ('bool' is a non-nullable value type)
Error   2        The name 'True' does not exist in the current context

Regards,

Paul
Online Developer, ICT
CEO Sydney

From: [email protected]<mailto:[email protected]> 
[mailto:[email protected]<mailto:[email protected]>] On Behalf 
Of Sezai Komur
Sent: Tuesday, 16 March 2010 12:18 PM
To: ozMOSS
Subject: Re: Code support

protected override void OnLoad(EventArgs e)

:)

Seems my writing code directly in email without intellisense aint up to scratch.
Sezai
On Tue, Mar 16, 2010 at 8:46 AM, Paul Noone 
<[email protected]<mailto:[email protected]>> 
wrote:
Hi Dan,

That would be why then. :)

OK. This is what I'm trying to do as per Sezai's suggestion the other day.

1.    Create custom control with pre-defined HTML content.

2.    Add a boolean column "NEALS" to my Article Page content type.

3.    Add this field to the required layout pages and wrap it in an 
editmodepanel so it only renders in edit mode and allows content authors to 
switch it on/off.

4.    Add my custom control to the layout page which renders the required 
content if the Boolean is set to True.
I'm sure the control should be very simple but I'm not sure what to inherit 
from or how to create a wrapper for the custom HTML content.

Should I be overriding CreateChildControls instead?

protected override void CreateChildControls()
{
  if ((SPContext.Current.ListItem["NEALS"] as Boolean) == True)
  {
           this.Controls.Add(new LiteralControl("<div id="myIcon">My HTML 
snippet here!</div>"));

Regards,

Paul
Online Developer, ICT
CEO Sydney

From: [email protected]<mailto:[email protected]> 
[mailto:[email protected]<mailto:[email protected]>] On Behalf 
Of Daniel W. Brown
Sent: Tuesday, 16 March 2010 11:31 AM
To: ozMOSS
Subject: RE: Code support

Howdy Paul,

The class, LiteralControl does not have a Page_Load method as it is a control :)

List of members: 
http://msdn.microsoft.com/en-us/library/system.web.ui.literalcontrol_members.aspx

You may need to override Init or Load depending on what you are tyring to do.

Also, http://msdn.microsoft.com/en-us/library/ms178472.aspx is a great resource 
for figuring out which methods are executed in the lifecycle of a control.

Cheers,

Daniel


From: [email protected]<mailto:[email protected]> 
[mailto:[email protected]<mailto:[email protected]>] On Behalf 
Of Paul Noone
Sent: Tuesday, 16 March 2010 10:48 AM
To: ozMOSS
Subject: Code support

Hi all,

Can anyone tell me what's wrong with this snippet.

I'm trying to override a server control that inherits from LiteralControl and 
am getting the following error.

'CEO.SharePoint.Controls.ShowNEALSlogo.Page_Load(object, System.EventArgs)': no 
suitable method found to override

using System;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Microsoft.SharePoint;

namespace CEO.SharePoint.Controls
{
    public class ShowNEALSlogo : LiteralControl
    {
        public override void Page_Load(object sender, System.EventArgs e)
        {
            if ((SPContext.Current.ListItem["NEALS"] as Boolean) == True)

Kind regards,

Paul Noone

---------------------------------------------------
Online Developer
Information Communication and Technology
Catholic Ecuation Office, Sydney
p: (02) 9568 8461
f: (02) 9568 8483
e: [email protected]<mailto:[email protected]>
w: http://www.ceosyd.catholic.edu.au/


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


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

<<inline: image001.jpg>>

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

Reply via email to