Hi,
I am trying to upload contacts to constant contact server using Bulk-Operation (using C#.NET).
I am using the following format provided at Constant Contact Developer site.
StringBuilder content = new StringBuilder();
content.Append("&data=");
content.Append(HttpUtility.UrlEncode("Email Address,", Encoding.UTF8));
content.Append(HttpUtility.UrlEncode("First Name,", Encoding.UTF8));
content.Append(HttpUtility.UrlEncode("Last Name", Encoding.UTF8));
content.Append(HttpUtility.UrlEncode("\n", Encoding.UTF8));
content.Append(HttpUtility.UrlEncode("shahid.saim@techno-soft.com,", Encoding.UTF8));
content.Append(HttpUtility.UrlEncode("First Name,", Encoding.UTF8));
content.Append(HttpUtility.UrlEncode("Last Name", Encoding.UTF8));
content.Append("&lists=");
content.Append(HttpUtility.UrlEncode("http://api.constantcontact.com/ws/customers/techno-soft/lists/1", Encoding.UTF8));
if i use the above code then it will upload
Email Address = shahid.saim@techno-soft.com
First Name = First Name
Last Name = Last Name
it is fine.
But the problem is, if i have "," character in any field value like,
StringBuilder content = new StringBuilder();
content.Append("&data=");
content.Append(HttpUtility.UrlEncode("Email Address,", Encoding.UTF8));
content.Append(HttpUtility.UrlEncode("First Name,", Encoding.UTF8));
content.Append(HttpUtility.UrlEncode("Last Name", Encoding.UTF8));
content.Append(HttpUtility.UrlEncode("\n", Encoding.UTF8));
content.Append(HttpUtility.UrlEncode("shahid.saim@techno-soft.com,", Encoding.UTF8));
content.Append(HttpUtility.UrlEncode("First, Name,", Encoding.UTF8));
content.Append(HttpUtility.UrlEncode("Last Name", Encoding.UTF8));
content.Append("&lists=");
content.Append(HttpUtility.UrlEncode("http://api.constantcontact.com/ws/customers/techno-soft/lists/1", Encoding.UTF8));
then it will upload
Email Address = shahid.saim@techno-soft.com
First Name = First
Last Name = Name
If there is any "," in field value. then it will consider the next column. So, it will disturb the whole mapping of columns.
if anyone have idea, how can i handle this "," character then help me.
... View more