Showing results for 
Search instead for 
Did you mean: 
Constant Contact wants to help you succeed! We’re celebrating our professional service programs on the Constant Contact Community this month and you have a chance to try one of the services for free! Learn more.

Custom Fields using ASP.NET

Custom Fields using ASP.NET



I'm trying to create a signup form with a few custom fields, but when I submit the form the contact gets created but none of the custom fields get saved to the contact.


Here's a snippet of my code I'm using in the code behind to save the custom field, am I missing something or doing something wrong?


if (!string.IsNullOrWhiteSpace(txtCustomfield.text)) {
    var customfield1 = new CustomField();
    customfield1.Name = "CustomField1";
    customfield1.Value = pAffected.Value;
    contact.CustomFields[0] = customfield1;
Honored Contributor

Re: Custom Fields using ASP.NET



Based on just that snippet of code, it looks like that should work. While it should be functionally the same, I would suggest the following code to assign the custom field:


Is it possible to share a larger snippet showing some of the logic for how you create and submit the contact data? (Please note that you'll want to censor your API key and access token from any code snippets that you share)



Elijah G.
API Support Engineer