Connecting Tech Pros Worldwide Help | Site Map

Passing information to a new window in .NET

 
LinkBack Thread Tools Search this Thread
  #1  
Old July 23rd, 2005, 07:50 PM
vinojairath@gmail.com
Guest
 
Posts: n/a
Default Passing information to a new window in .NET

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.


  #2  
Old July 23rd, 2005, 07:50 PM
SCDeveloper
Guest
 
Posts: n/a
Default 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

  #3  
Old July 23rd, 2005, 07:50 PM
vinojairath@gmail.com
Guest
 
Posts: n/a
Default Re: Passing information to a new window in .NET

Thanks.

  #4  
Old July 23rd, 2005, 07:50 PM
Tony
Guest
 
Posts: n/a
Default 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#?


  #5  
Old July 23rd, 2005, 07:51 PM
vinojairath@gmail.com
Guest
 
Posts: n/a
Default Re: Passing information to a new window in .NET


I'm using C#.

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

  #6  
Old July 23rd, 2005, 08:00 PM
Thomas 'PointedEars' Lahn
Guest
 
Posts: n/a
Default 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
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

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 220,989 network members.