Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

New browser window & passing parameters... 1

Status
Not open for further replies.

Mang007

Programmer
Apr 10, 2002
8
0
0
BE
Hi!!!

I want to open a page in a new window, the problem is I need to pass some parameters to the new page...
I'd already try a javascript function but it doesn't work...

Thank you verry much...
 
You could use Session-variables to do this.

Session(&quot;<variable>&quot;) = ...

On the next page you can use that variable in the same way. If you don't need it anymore you can destroy it by using this function : Session.remove(&quot;<variable>&quot;)

You can also use cookies, but I still prefer those session variables (a lot easier to work with ;-)).
 
Ok!!!! Thank you!!

But I still have one problem
Here is the function I use to open the window and the call to it :
<script language=&quot;JScript&quot;>
function newWin(url)
{
window.open(url)
}
</script>

<asp:button id=&quot;btnSelectUsr&quot; runat=&quot;server&quot; Text=&quot;Select&quot; OnClick=&quot;newWin('Report.aspx?type=UC&user=ADAM')&quot;></asp:button>

When I run the page, I've got the following error :
<snip>
'newWin' is not a member of 'ASP.Selection_aspx'
</snip>
 
We got the same error message. When you do the server transfer to the same frame you can better use

Server.Transfer(&quot;Report.aspx&quot;)

If you want the page to open in another frame I don't know the answer either.
 
I found another solution :
I was using a WebForms button, so all the code behind was on the server. I just change the button to a simple HTML button and it works!!!

Thank you for your helpful advices!!
 
gd082!!!! OMG, you've saved me from the hell that is parsing through the query string!!!
:D

I assumed that a new session started with a new browser window showing up, so I figured the only way to pass variables was with query string info.

I had no clue the session would work, but now that I think about it, the ways that asp.net can manage session makes it all make sense.
:D

Thanks again

Jack
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top