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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Doubt creating a class/function? 5
Pass ASP.NET/VB.NET variable to javascript 2
Passing data 2
Doubt template 1
Doubt new window 1
ASP.NET Page refreshes Twice 2
How do I fix my querystring value? 2
GridView 1

Back
Top