private void UpdateReferences() { int identityId = int.Parse(cboClient.SelectedValue); List <Entities.JobReference> references = new List <Entities.JobReference>(); Facade.IOrganisationReference facOrganisationReference = new Facade.Organisation(); foreach (RepeaterItem item in repReferences.Items) { int referenceId = Convert.ToInt32(((HtmlInputHidden)item.FindControl("hidOrganisationReferenceId")).Value); string referenceValue = ((TextBox)item.FindControl("txtReferenceValue")).Text; // Create a new reference and add it to the reference collection Entities.JobReference jobReference = new Entities.JobReference(); jobReference.JobId = m_jobId; jobReference.Value = referenceValue; jobReference.OrganisationReference = facOrganisationReference.GetReferenceForOrganisationReferenceId(referenceId); references.Add(jobReference); } Facade.IJob facJob = new Facade.Job(); facJob.ChangeClient(m_jobId, identityId, references, ((Entities.CustomPrincipal)Page.User).UserName); mwhelper.CloseForm = true; mwhelper.CausePostBack = true; mwhelper.OutputData = "<changeClient />"; }