Post form data to 3rd party URL in Asp.Net

In this post, we will discuss how we can send form data to a 3rd party URL in Asp.Net.

New to Office 365 SharePoint Online? Get Office 365 Enterprise E3 Subscription & Try out all the features

Also, you can check my previous posts on MVC 4 tutorial,

Generics tutorial in C#.Net

Tutorial on Cookies in

There will be certain situations where you will not prefer to send data through a query string to a 3rd party URL. In that, we can use the post method to send data to the 3rd party URL.

For this we have to write a JavaScript method as well as we need to put input variables inside the form tag. Follow the below code:

<%@ Page Language=”C#” AutoEventWireup=”true” CodeFile=”Default.aspx.cs” Inherits=”_Default” %>

<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “”>
<html xmlns=””>
<head runat=”server”>
<title>Post form data to 3rd party URL in Asp.Net</title>
<script language=”javascript” type=”text/javascript”>
function postvaluesTraining() {
document.forms[0].action = ‘http://UR 3rd Party URL/welcome.aspx’;
return true;
<form id=”form1″ runat=”server”>
<input type=”hidden” name=”Name” value=”aspdotnethelp” />
<input type=”hidden” name=”siteURL” value=”” />
<input type=”hidden” name=”email” value=”” />

Check out Best Alternative to InfoPath -> Try Now


(Installation & Features)

About Bijay Kumar

I am Bijay from Odisha, India. Currently working in my own venture TSInfo Technologies in Bangalore, India. I am Microsoft Office Servers and Services (SharePoint) MVP (5 times). I works in SharePoint 2016/2013/2010, SharePoint Online Office 365 etc. Check out My MVP Profile.. I also run popular SharePoint web site

View all posts by Bijay Kumar →