How to submit a page on the popup page?

Posted by SheoNarayan under ASP.NET category on | Points: 40 | Views : 3582
In order to post the current page on the popup page, following code snippet can be written.

<input type="button" value="Post On Another Page" onclick="PostForm()" />

<script language="javascript" type="text/javascript">
function PostForm(id)
var form = document.forms[0];
form.action = "AnotherPage.aspx; // popup page url = "_blank"; //open in another window

form.action = "currentpage.aspx"; // url of the current page = ""; // remove the target you had specified

On the AnotherPage.aspx, write following code snippet in the Page Load to get the values of the control placed on the currentpage.aspx

foreach (string key in Request.Form.Keys)
if (key.Contains("yourtextboxid"))
string myTextBoxValue = Request.Form[key];

Hope this will be helpful.

Comments or Responses

Login to post response