La référence d'objet n'est pas définie à une instance d'un objet.
Bonjour,
j'obtiens cette erreur :
Citation:
La référence d'objet n'est pas définie à une instance d'un objet.
voici le code :
EndUser : classe utilisateur
Address : class address
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
|
EndUser enduser = new EndUser();
if (IsValid)
{
enduser.EndUserTypeID = (int) Enums.EndUserType.CUSTOMER;
enduser.FirstName = textFirstname.Text;
enduser.LastName = textLastname.Text;
==> enduser.Address.AddressLine = textAddress.Text ;
enduser.Address.AddressLine2 = textAddress2.Text;
enduser.Address.City = textCity.Text;
enduser.Address.State = textState.Text;
enduser.Address.PostalCode = textPostalCode.Text;
enduser.Password = textPassword.Text;
enduser.ContactInformation.Email = textEmail.Text;
enduser.ContactInformation.Phone = textPhone.Text;
enduser.ContactInformation.Phone2 = textPhone2.Text;
enduser.ContactInformation.Fax = textFax.Text;
enduser.IsSubscribed = checkboxNewsletter.Checked; |
Merci de m'aider