ASPForums.Net RSS Feedhttp://www.aspforums.net/Handlers/RSS.ashxLatest additions to the content that appears on ASPForums.Net(c) 2019 www.aspforums.com. All rights reserved.Pass data from one server to another server with webservice using C# and VB.Net in ASP.NetHi @Waghmare,<br />Please try the following<br /><br /><a href = 'link(Threads/114017/Pass-data-from-one-Form-to-another-Form-in-Windows-Forms-WinForms-Application-using-C-Net/)'>Pass data from one Form to another Form in Windows Forms (WinForms) Application using C# .Net</a><br /><br />It might help you.<br /><br />Cheers Andrea.https://www.aspforums.net:443/Threads/142982/Pass-data-from-one-server-to-another-server-with-webservice-using-C-and-VBNet-in-ASPNet/https://www.aspforums.net:443/Threads/142982/Pass-data-from-one-server-to-another-server-with-webservice-using-C-and-VBNet-in-ASPNet/Fri, 08 Sep 2017 05:02:12 GMTPass data from one server to another server with webservice using C# and VB.Net in ASP.Net<p>Hi <a class="username" rel="Waghmare"> Waghmare</a>,</p> <p>Refer the below article for your reference to how to transfer data from one website to another the website.</p> <h1 class="header"><a title="How to transfer data from one website to another in ASP.Net'a" href="https://www.aspsnippets.com/Articles/How-to-transfer-data-from-one-website-to-another-in-ASPNet.aspx">How to transfer data from one website to another in ASP.Net</a></h1> <p>Also refer below link how to create WebServices.</p> <h1 class="header"><a title="Simple Tutorial to create WCF Service (SVC) step by step with example in ASP.Net'a" href="https://www.aspsnippets.com/Articles/Simple-Tutorial-to-create-WCF-Service-SVC-step-by-step-with-example-in-ASPNet.aspx">Simple Tutorial to create WCF Service (SVC) step by step with example in ASP.Net</a></h1> <p>Form both reference link you can implement applications to transfer data from one application to another using WebServices.</p> <p>Here i have created two applications one from which we call WebServices to transfer data to another application. Just you need to note you have to add exact URL of your second application with the correct port no of application.</p> <p> <strong>WebService</strong></p> <p><strong>Service1.SVC</strong></p> <pre class="brush: csharp"> public class Service1 : IService1 { public void TransferData(string firstName, string lastName, string returnUrl) { ASCIIEncoding encoding = new ASCIIEncoding(); string data = string.Format(&#34;FirstName={0}&amp;LastName={1}&#34;, firstName, lastName); byte[] bytes = encoding.GetBytes(data); HttpWebRequest httpRequest = (HttpWebRequest)WebRequest.Create(returnUrl); httpRequest.Method = &#34;POST&#34;; httpRequest.ContentType = &#34;application/x-www-form-urlencoded&#34;; httpRequest.ContentLength = bytes.Length; using (Stream stream = httpRequest.GetRequestStream()) { stream.Write(bytes, 0, bytes.Length); stream.Close(); } } }</pre> <p>&nbsp;</p> <p><strong>FirstApplication </strong>(<strong>PostDataFromOneWebsiteToAnother)</strong></p> <p><strong>HTML</strong></p> <pre class="brush: html"> &lt;div&gt; &lt;asp:Button ID=&#34;Button1&#34; runat=&#34;server&#34; Text=&#34;Button&#34; onclick=&#34;Button1_Click&#34; /&gt; &lt;/div&gt;</pre> <p><strong>C#</strong></p> <pre class="brush: csharp"> protected void Button1_Click(object sender, EventArgs e) { Service.Service1Client client = new Service.Service1Client(); client.TransferData(&#34;Mudassar&#34;, &#34;Khan&#34;, &#34;http://localhost:62949/PostDataFromOneWebsiteToAnother2/Default.aspx&#34;); }</pre> <p><strong>VB.Net</strong></p> <pre class="brush: vb"> Protected Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs) Dim client As New Service.Service1Client() client.TransferData(&#34;Mudassar&#34;, &#34;Khan&#34;, &#34;http://localhost:62949/PostDataFromOneWebsiteToAnother2/Default.aspx&#34;) End Sub</pre> <p><strong>SecondApplication </strong>(<strong>PostDataFromOneWebsiteToAnother2)</strong></p> <p><strong>C#</strong></p> <p>&nbsp;</p> <pre class="brush: csharp"> protected void Page_Load(object sender, EventArgs e) { if (Request.Form.Count &gt; 0) { string firstName = Request.Form[&#34;FirstName&#34;]; string lastName = Request.Form[&#34;LastName&#34;]; } }</pre> <p><strong>&nbsp;VB.Net</strong></p> <pre class="brush: vb">Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load If Request.Form.Count &gt; 0 Then Dim firstName As String = Request.Form(&#34;FirstName&#34;) Dim lastName As String = Request.Form(&#34;LastName&#34;) End If End Sub</pre> <p>&nbsp;</p>https://www.aspforums.net:443/Threads/142982/Pass-data-from-one-server-to-another-server-with-webservice-using-C-and-VBNet-in-ASPNet/https://www.aspforums.net:443/Threads/142982/Pass-data-from-one-server-to-another-server-with-webservice-using-C-and-VBNet-in-ASPNet/Fri, 08 Sep 2017 07:22:44 GMT