datla Posted January 12, 2007 Share Posted January 12, 2007 I have two server.I want submit a form in the web page to another page in other server. Link to comment Share on other sites More sharing options...
aspnetguy Posted January 12, 2007 Share Posted January 12, 2007 you can submit the action of the form to the url of the other page on the other server Link to comment Share on other sites More sharing options...
datla Posted January 12, 2007 Author Share Posted January 12, 2007 I code in ASP.Net 2.0I used MasterPageI tried it but I can not get value Link to comment Share on other sites More sharing options...
datla Posted January 12, 2007 Author Share Posted January 12, 2007 I code in ASP.Net 2.0I used MasterPageI tried it but I can not get value.I tried this code:a Webpage in first server:Default.aspx: <%@ Page Language="VB" MasterPageFile="~/submit_form/MasterPage.master" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="submit_form_Default" title="Untitled Page" %><asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder2" Runat="Server"> <script language="javascript" type="text/javascript"> function noPostBack(sNewFormAction) { document.forms[0].action = sNewFormAction; document.forms[0].__VIEWSTATE.name = 'NOVIEWSTATE'; document.forms[0].submit(); } </script> <asp:TextBox runat="server" ID="txt" Text="here"></asp:TextBox> <input type="button" id="btnSubmit" value="Submit Order" runat="server" onlick="noPostBack('http://localhost/Test/submit_form/Default1.aspx');" /></asp:Content> The page in Another Server:Default.vb: Partial Class submit_form_Default1 Inherits System.Web.UI.Page Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load lbl.Text = Request.Form("ctl00_ContentPlaceHolder2_txt") End SubEnd Class This is my problem:When I submit from in first server.I can not get value from Default.aspx in first server.Please help me.thank you very much! Link to comment Share on other sites More sharing options...
aspnetguy Posted January 12, 2007 Share Posted January 12, 2007 On your master page what is the action value of the form??? Link to comment Share on other sites More sharing options...
jesh Posted January 12, 2007 Share Posted January 12, 2007 On your master page what is the action value of the form???I appears that the action is being set in the java script: function noPostBack(sNewFormAction) { document.forms[0].action = sNewFormAction; document.forms[0].__VIEWSTATE.name = 'NOVIEWSTATE'; document.forms[0].submit(); } To http://localhost/Test/submit_form/Default1.aspx. Is your second server running on localhost? And is the website called "Test"? Link to comment Share on other sites More sharing options...
datla Posted January 15, 2007 Author Share Posted January 15, 2007 My Master Page action value is : "http://localhost/Test/submit_form/Default1.aspx". <input type="button" id="btnSubmit" value="Submit Order" runat="server" onlick="noPostBack('http://localhost/Test/submit_form/Default1.aspx');" /> and function noPostBack(sNewFormAction){ document.forms[0].action = sNewFormAction; document.forms[0].__VIEWSTATE.name = 'NOVIEWSTATE'; document.forms[0].submit();} yes. My second server running on localhost. And the website called "Test".thanks. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now