Developer forum

Forum » Development » c# set item-value of Area

c# set item-value of Area

Jonas Mersholm
Reply

Hi,

I have a copied language-layer area:

var Newarea = MainArea.Copy(Dynamicweb.Content.Area.CopyMode.StructureAndContent, true, true, true, true, true );

 

How would i be able to set the item value for the given website? The website has an Item with two fields:

1) Text-field named "Identifier"

2) Link field named "Link"

 

Thanks in advance


Replies

 
Vladimir
Reply

Hi Jonas,

I think it is possible in the following way:

var item = Items.ItemManager.Storage.GetById(Newarea.ItemType, Newarea.ItemId);
item["Identifier"] = "007"; 
item["Link"] = "Default.aspx?ID=1"; 
item.Save();

Best regards,

Vladimir

 

You must be logged in to post in the forum