You need to sign in to do that
Don't have an account?
WebToLead <form> tag
Hi All
We are migrating our current web site content to a CMS which is build with MS .Net Framework, and on my previous old HTML web site I have a simple HTML Web Page for SF Campaign Registration process (WebToLead), but now in .Net CMS I cannot set a <form> tag as WebToLead HTML page requires because that breaks the .Net CMS Logic. So I just wondering if there is a different way to integrate WebToLead but perhaps consuming a Web Service API. I wouldn't like to have to host a isolate HTML Page for WebToLead process on my web server 'cause I'll miss all CMS functionality.
Any ideas?
Thanks.
Hi All,
I worked around this request using server code as shown below:
// Create a request using a URL that can receive a post.
WebRequest request = WebRequest.Create("https://www.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8");
// Set the Method property of the request to POST.
request.Method = "POST";
// Create POST data and convert it to a byte array.
string postData = "oid=00Dd00XXXX&Campaign_ID=701d000XXX&first_name=JOHN&last_name=SMITH&email=JOHNSMITH@TEST.COM&company=...";
byte[] byteArray = Encoding.UTF8.GetBytes(postData);
// Set the ContentType property of the WebRequest.
request.ContentType = "application/x-www-form-urlencoded";
// Set the ContentLength property of the WebRequest.
request.ContentLength = byteArray.Length;
// Get the request stream.
Stream dataStream = request.GetRequestStream();
// Write the data to the request stream.
dataStream.Write(byteArray, 0, byteArray.Length);
// Close the Stream object.
dataStream.Close()
This is a .Net C# Code I used to submit a sucessfull Web-To-Lead post.
Carlos.