Hi,
I am trying to initialise a multiplelookupfield control from the code behind, but it is not updating. If I declare it on the page with all the parameters it works but it is blank if I do the same thing in code.
<div>
Test 2
<SharePoint:MultipleLookupField ID="MultipleLookupField2" ControlMode="Edit" runat="server"></SharePoint:MultipleLookupField>
</div>
<div>
Test 2
<SharePoint:MultipleLookupField ID="MultipleLookupField3" ListId="68B4FA77-CC06-44B2-8893-68D0DB5183B3" ItemId="4" FieldName="Attendees" ControlMode="Edit" runat="server"></SharePoint:MultipleLookupField>
</div>
If I set the multiplelookupfield2 in the page load event nothing appears. But when set in the markup it works. Any help would be really appreciated. I am new to Sharepoint and honestly I have forgotten all the asp.net controls. I don't know where I am going wrong.
private void SetControlValues(SPListItem item)
{
MultipleLookupField1.ListId = new Guid("68B4FA77-CC06-44B2-8893-68D0DB5183B3");
MultipleLookupField1.ItemId = 4;
MultipleLookupField1.FieldName = "Attendees";
MultipleLookupField1.UpdateFieldValueInItem();
}