Dashsa Dashsa - 2 months ago 31
C# Question

.Net C# post form to external URL

I am new to .NET - I have been a classic ASP developer for a while.
I am trying to post an HTML form to saleforce and I am having some issues.
I am using .NET webforms 4.0 with a master page.

If I was doing this in classic ASP, I would simply change the form action to the Salesforce URL. But with webforms, I guess the form is submitting back to the page.

I think I am supposed to postback and collect the data form the form and then send it to salesforce, but I am not sure how to do that...
Thanks for any help!


The answer is simply: don't use a webform (runat="server") and instead just create a regular old form. Then set the action attribute to post to salesforce and you're done.

This would be how you'd do it compared to the classic ASP method, which doesn't have webforms (viewstate, viewbag, etc).