protected void BuyButton_Click(object sender, EventArgs e)
 {
     if (Contact != null)
     {
         try
         {
             IDataComConfiguration configuration  = DataComHelper.GetConfiguration(SiteIdentifierParameter);
             NetworkCredential     userCredential = configuration.GetUserCredential();
             if (userCredential != null)
             {
                 DataComClient    client     = DataComHelper.CreateClient(configuration);
                 IContactProvider provider   = new UserContactProvider(client, userCredential);
                 Contact          contact    = provider.GetContact(Contact.ContactId, true);
                 JsonSerializer   serializer = new JsonSerializer();
                 ContactHiddenField.Value = serializer.Serialize(contact);
             }
             else
             {
                 ErrorSummary.Report(GetString("datacom.nousercredential"));
                 BuyButton.Enabled = false;
             }
         }
         catch (Exception exception)
         {
             HandleException(exception);
         }
     }
 }
 protected void BuyButton_Click(object sender, EventArgs e)
 {
     if (Contact != null)
     {
         try
         {
             ICredentialProvider credentialProvider = new UserCredentialProvider(MembershipContext.AuthenticatedUser);
             NetworkCredential userCredential = credentialProvider.GetCredential();
             if (userCredential != null)
             {
                 DataComClient client = DataComHelper.CreateClient();
                 IContactProvider provider = new UserContactProvider(client, userCredential);
                 Contact contact = provider.GetContact(Contact.ContactId, true);
                 JsonSerializer serializer = new JsonSerializer();
                 ContactHiddenField.Value = serializer.Serialize(contact);
             }
             else
             {
                 ErrorSummary.Report(GetString("datacom.nousercredential"));
                 BuyButton.Enabled = false;
             }
         }
         catch (Exception exception)
         {
             HandleException(exception);
         }
     }
 }