Integrating a form that requires posting with our CMS

We are running on an older version of Sitefinity (3.7sp4) which is an asp.net 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="http://mymarketoprocessingpage.com/page.php/processingpage" 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;
                        break;
                    }
                }

                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 = "http://mymarketoprocessingpage.com/page.php/processingpage";
                    myHTMLForm.Name = MarketoFormID;
                }

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

Thanks!
LVL 2
EndeavorToPersevereAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

qubiqCommented:
If I understand you well, you want the asp.net 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.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
EndeavorToPersevereAuthor Commented:
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 :-)
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP.NET

From novice to tech pro — start learning today.