This project is read-only.

Remove image from NewsIem Page

Topics: Developer Forum
Jan 22, 2009 at 6:59 PM
hi! how can i remove the image that's in News Item Page programmatically i added this: to News Class. my intention on adding this is to have a image on the News list not on the News Item

[FileAttachment, EditableImage("Image", 90, ContainerName = Tabs.Content, CssClass = "main")]
        public virtual string Image
        {
            get { return (string)(GetDetail("Image") ?? string.Empty); }
            set { SetDetail("Image", value, string.Empty); }
        }
Jan 23, 2009 at 9:45 PM
I think I'm missing the crucial piece. Don't you just remove it from the news class and add it to the news list class?
Jan 24, 2009 at 3:40 AM
ok i've tried to put it on the news list class but i'm getting an error now

The editor 'Image' references a container 'content' that doesn't seem to bedefined. Either add a container with this name or remove the reference to thatcontainer.

N2.N2Exception: The editor 'Image' references a container 'content' that doesn'tseem to be defined. Either add a container with this name or remove thereference to that
Jan 26, 2009 at 7:09 PM
Remove "ContainerName = Tabs.Content" from the editable attribute.
Apr 6, 2010 at 8:19 AM

hi c90!

You should add this code in top page News.cs

good luck!

 

using System.Text.RegularExpressions;
using N2.Serialization;