Passing information to a new window in .NET 
July 23rd, 2005, 08:50 PM
| | | |
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. | 
July 23rd, 2005, 08:50 PM
| | | | 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 | 
July 23rd, 2005, 08:50 PM
| | | | re: Passing information to a new window in .NET
Thanks. | 
July 23rd, 2005, 08:50 PM
| | | | 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#? | 
July 23rd, 2005, 08:51 PM
| | | | re: Passing information to a new window in .NET
I'm using C#.
Do I not need the script to open a new window? | 
July 23rd, 2005, 09:00 PM
| | | | 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 |  | | | | /bytes/about
We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights.
Get the best answers to your questions from over 225,689 network members.
|