Integrating a form that requires posting with our CMS

EndeavorToPersevere used Ask the Experts™
We are running on an older version of Sitefinity (3.7sp4) which is an based CMS. It uses master pages with ascx controls.  I need to integrate a form from Marketo. It was given to me as an html page with a bunch of Javascript embedded that looks like
<form class="lpeRegForm formNotEmpty" method="post" enctype="application/x-www-form-urlencoded"
    action="" id="form7" name="form7">

I figured out how to get everything in there except dealing with the form. I wrote an ascx control that fetches the staged page from the CMS and tries to change the form for posting but it is not working. I'm not sure if my code is wrong or my design :-)  Any ideas?

                IStagedPage stagedPage = pageFromDb.Staged;                

                // find the form control on the staged page
                ICmsWebControl myForm = null;
                foreach (ICmsWebControl pageControl in stagedPage.Controls)
                    if (!String.IsNullOrEmpty(pageControl.Name)
                        && (pageControl.Name.ToLower().Contains("form")))
                        myForm = pageControl;

                if (myForm != null)
                    //found the form control, reference it as an HTML form so we can get
                    // to the fields we need
                    HtmlForm myHTMLForm = (HtmlForm)myForm;
                    myHTMLForm.ID = MarketoFormID;
                    myHTMLForm.Method = "post";
                    myHTMLForm.Enctype = "application/x-www-form-urlencoded";
                    myHTMLForm.Action = "";
                    myHTMLForm.Name = MarketoFormID;

What's the best way to integrate forms that want to post like SalesForce and Marketo forms into an based CMS?

Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
If I understand you well, you want the page, fill out the form and send its contents at that address with PHP original form. Is that so?
I think that's how you do it does not work (but I'm not sure).
I would do it so, that I did normal ASP.NET form and after it I get the necessary information, so I sent them programmatically to PHP. I tryed create a WebRequest and through him sent all data.
If you have the original HTML form itself works - exactly what and how sends
you can easily see through Fidler or a similar utility.


I didn't get this working and we ended up using our existing SOAP interface to SalesForce to put the fields in and then have them sync over to Marketo.

I did see that the Link Button has a PostBackURL field though so when I get a chance I want to play with that and see if that might do what I needed here.

Thanks for the ideas. Unfortunately I had just a couple of days to get this working and had to just run with what we could get to work fast :-)

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial