Doubt passing values

  • Thread starter Thread starter Paulo Roberto
  • Start date Start date
P

Paulo Roberto

Hi, Im using VS 2005 C# 2.0 and I need to open a new window, using
JavaScript and pass some values...

How can I do that not using the get method QueryString
(file.aspx?name=something)... ???

Some alternatives ? Is it possible to be done ?

Thanks !
 
Paulo said:
Hi, Im using VS 2005 C# 2.0 and I need to open a new window, using
JavaScript and pass some values...

How can I do that not using the get method QueryString
(file.aspx?name=something)... ???

Some alternatives ? Is it possible to be done ?

Thanks !

You can open a new window and post a form to it.

Make a form that posts to a popup:

<form id="PopupForm" action="file.aspx" target="Popup">
<input type="hidden" name="some" />
<input type="hidden" name="more" />
<input type="hidden" name="other" />
</form>

Set the values in the form, open an empty popup, and post the form to it:

var frm = document.getElementById('PopupForm');
frm.some.value = '42';
frm.more.value = 'yeah!';
frm.other.value = '-1';
window.open('','Popup');
frm.submit();

The values sent to the page can be found in the Request.Form collection.
 
Back
Top