473,395 Members | 1,496 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

How to transfer my DataTable to a PopUp Window? Context? Session?

Hello,
which is the best way to transfer my DataTable to a PopUp Window?
Using Context would be great but I it seems not to work.

Which is the best solution?

Thanks in advance,
Andreas
Nov 18 '05 #1
2 4860
use a session...

in the code where you launch the pop up from you'd have something like:

....
// store the datatable
Session["DataTable"] = sourceDt;

// write some script to launch the pop up
string szJavaScript = " <SCRIPT language=javascript>" +
System.Environment.NewLine +
" window.open('MYPOPUP.ASPX', '_blank',
'width=300,height=150,top=250,left=350,toolbar=no, scrollbars=no,status=no,re
sizable=no', 'true');" + System.Environment.NewLine +
" </SCRIPT>";
RegisterClientScriptBlock( "LaunchPopup", szJavaScript );
......
replace the 'MYPOPUP.ASPX' with your popup name.

then in the Page_Load of your pop up window you'd have something like

// get the datatable
object objDataTable = Session["DataTable"];
DataTable dt;
if ( objDataTable is DataTable )
{
dt = (DataTable) objDataTable;
// .....do your business with it here....
}
be careful of word wrapping in this document, if you're using VB and need it
in that, lemme know and I'll do that for you.

hope that helps.

Dan.
"Andreas Klemt" <ak******@hotmail.com> wrote in message
news:%2***************@TK2MSFTNGP10.phx.gbl...
Hello,
which is the best way to transfer my DataTable to a PopUp Window?
Using Context would be great but I it seems not to work.

Which is the best solution?

Thanks in advance,
Andreas

Nov 18 '05 #2
Hello Daniel,
many thanks for the code!!

Kind Regards,
Andreas

"Daniel Bass" <I'm really @ sick of spam> schrieb im Newsbeitrag
news:e1**************@TK2MSFTNGP12.phx.gbl...
use a session...

in the code where you launch the pop up from you'd have something like:

...
// store the datatable
Session["DataTable"] = sourceDt;

// write some script to launch the pop up
string szJavaScript = " <SCRIPT language=javascript>" +
System.Environment.NewLine +
" window.open('MYPOPUP.ASPX', '_blank',
'width=300,height=150,top=250,left=350,toolbar=no, scrollbars=no,status=no,re sizable=no', 'true');" + System.Environment.NewLine +
" </SCRIPT>";
RegisterClientScriptBlock( "LaunchPopup", szJavaScript );
.....
replace the 'MYPOPUP.ASPX' with your popup name.

then in the Page_Load of your pop up window you'd have something like

// get the datatable
object objDataTable = Session["DataTable"];
DataTable dt;
if ( objDataTable is DataTable )
{
dt = (DataTable) objDataTable;
// .....do your business with it here....
}
be careful of word wrapping in this document, if you're using VB and need it in that, lemme know and I'll do that for you.

hope that helps.

Dan.
"Andreas Klemt" <ak******@hotmail.com> wrote in message
news:%2***************@TK2MSFTNGP10.phx.gbl...
Hello,
which is the best way to transfer my DataTable to a PopUp Window?
Using Context would be great but I it seems not to work.

Which is the best solution?

Thanks in advance,
Andreas

Nov 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: ryan | last post by:
Hello and sorry for the crosspost, I have a php page that uses sessions. The page has a button that opens a popup window. The popup window is itself a php page and also uses the session. When I...
5
by: Tom | last post by:
Hi I am trying to transfer to a different .ASPX page using Server.Transfer. However, I get the following error: "Error executing child request for .aspx." Anyone know why? Thanks for...
9
by: Jimmy Junatas | last post by:
When we open a window (using client-side jscript ie. window.open("/Site/Popup.aspx?...",...)) from Page1.aspx, the called page Popup.aspx does not have access to the Session variables present in...
2
by: Joe Molloy | last post by:
Hi, This isn't a mission critical question but I thought I'dl throw it out there for your feedback as it's a bit curious. I have developed a shopping cart for an application I'm working on...
0
by: ChrisB | last post by:
I'm attempting to open a new window from a LinkButton in a DataGrid. I can set a session variable in the ItemCommand event for the LinkButton like so: // this is used to handle the ItemCommand...
0
by: Chris Ericoli | last post by:
Hi, I am working with an 'in session' ado dataset with an asp.net application. My dataset is comprised of two tables, one of which maintains a few calculated datacolumns. For some reason these...
1
by: Earl Teigrob | last post by:
I did a ton of searching to try and find a simple solution to this issue and finally wrote my own, which I am sharing with everyone. In my searching, I did find a very complete and robust solution at...
2
by: David Berman | last post by:
It seems that my site is losing session information when using Server.Transfer. I have a page called PictureGallery.aspx. It takes an argument which is an index id, so it would look like...
2
by: VMI | last post by:
I have a LinkButton_search on my Page1.aspx that opens up a popup page called popup.aspx. I do this with LinkButton.Attributes.Add() on the Page_Load of Page1.aspx. How can I add server-side code...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.