Monday, 28 January 2013

Pass values from domain to other


One of the methods could be "Post" the page to the other page in different domain. and read data using request - response model.
Lets you have page1.aspx in domain1 and page2.aspx in domain2.
you habe to pass the data from page1 to page2.


Page1 -
<form id="frm" name="frm" method="post" runat="server" action="http://domain2/page2.aspx">
   <asp:TextBox id="TextBox1" runat="server"></asp:TextBox>
   <asp:TextBox id="TextBox2" runat="server"></asp:TextBox>
</form>
Now on a button click on this form you need to submit the form -
js -

function SubmitThis()
{
  document.frm.submit();
}
========================
now on page2 -
cs-
txt1 = Request["TextBox1"].ToString();
txt2 = Request["TextBox2"].ToString();

No comments:

Post a Comment