Connecting Tech Pros Worldwide Forums | Help | Site Map

Passing information to a new window in .NET

vinojairath@gmail.com
Guest
 
Posts: n/a
#1: Jul 23 '05
Hi,

This is my first-time posting, so apologies if format etc. is not
correct.

I have a my.aspx page containing fields that have been manually
populated (e.g. a textbox). With a click of a button I want another
my.apsx window to open populated with the same information.

I found the following Javascript to open a new window:

<script type="text/javascript">
function openwindow(ipt)
{

window.open(ipt,"new_window","*toolbar=no,location =no,directories=no,status=no,menubar=no,scrollbars =yes,resizable=yes,copyhistory=yes,width=400,heigh t=400,top=0,eft=0");

}
</script>

onclick="javascript:openwindow('my.aspx')"

But I do I pass the information from one page to the other?

Thanks, V.


SCDeveloper
Guest
 
Posts: n/a
#2: Jul 23 '05

re: Passing information to a new window in .NET


Add the parameters to the onclick line.

For examples, two parameters, ID and test, are passed to the page.

onclick="javascript:openwindow*('my.aspx?ID=123&te st=yes')"
or
onclick="javascript:openwindow*('my.aspx?ID=" + ID.value + "&test="+
test.value + "')"

SCDeveloper
http://www.sharingcorner.com

vinojairath@gmail.com
Guest
 
Posts: n/a
#3: Jul 23 '05

re: Passing information to a new window in .NET


Thanks.

Tony
Guest
 
Posts: n/a
#4: Jul 23 '05

re: Passing information to a new window in .NET



<vinojairath@gmail.com> wrote in message
news:1116247818.371276.114700@g14g2000cwa.googlegr oups.com...[color=blue]
>
>I have a my.aspx page containing fields that have been manually
>populated (e.g. a textbox). With a click of a button I want another
>my.apsx window to open populated with the same information.
>
>I found the following Javascript to open a new window:
>
> <script type="text/javascript">
> function openwindow(ipt)
> {
>
>window.open(ipt,"new_window","*>toolbar=no,locati on=no,directories=no,status=no,menubar=no,scrollba rs=yes,resizable=yes,copyhistory=yes,width=400,hei ght=400,top=0,eft=0");
>
> }
> </script>
>
> onclick="javascript:openwindow('my.aspx')"
>
>But I do I pass the information from one page to the other?[/color]

Is there a particular reason for doing this in JavaScript, when you could do
it completely from the aspx?

Are you using VB or C#?


vinojairath@gmail.com
Guest
 
Posts: n/a
#5: Jul 23 '05

re: Passing information to a new window in .NET



I'm using C#.

Do I not need the script to open a new window?

Thomas 'PointedEars' Lahn
Guest
 
Posts: n/a
#6: Jul 23 '05

re: Passing information to a new window in .NET


vinojairath@gmail.com wrote:
[color=blue]
> [...]
> Do I not need [...] to open a new window?[/color]

Yes, you do not.


PointedEars
Closed Thread