473,503 Members | 1,711 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

passing data from one page to another

I have a .aspx page (we'll call it Form1) with a
datagrid on it. The datagrid is populated from a dataset
that I manually entered data into (the data isn't in a
database). The datagrid on Form1 also has a button column
on it.
I have another .aspx page (Form2) with an
unpopulated datagrid on it. I want to populate it with
all the columns from the row where the button was clicked
on Form1.
I know how to do what I want with the datagrid
formatting. I know how to open the second page with
javascript. I just don't know how to pass the row from
Form1 to Form2. It has been recommended to me to use a
Cache but I don't know where to begin. I know how to add
the data to a cache, but how do I access it from the
second page?

Any help is greatly appreciated.

Thank you,

Brian Smith
Nov 17 '05 #1
3 12656
It wouldn't make sense to add the items to the cache unless your data is the
same throughout your web app, ie. not user session specific.

You might want to use the Context object (which is a Page property) and add
your items to it using:

Context.Items.Add("dr1",drMyDataRow);

Follow this up with a Server.Transfer("page2.aspx"); and you will be able to
retrieve the Items from the Context object again.

This is a very effective way of passing data between ASP.NET pages.

Hope that helps.

Cheers,
Wim Hollebrandse
http://www.wimdows.com
http://www.wimdows.net

"Brian Smith" <sm****@mantech-wva.com> wrote in message
news:08****************************@phx.gbl...
I have a .aspx page (we'll call it Form1) with a
datagrid on it. The datagrid is populated from a dataset
that I manually entered data into (the data isn't in a
database). The datagrid on Form1 also has a button column
on it.
I have another .aspx page (Form2) with an
unpopulated datagrid on it. I want to populate it with
all the columns from the row where the button was clicked
on Form1.
I know how to do what I want with the datagrid
formatting. I know how to open the second page with
javascript. I just don't know how to pass the row from
Form1 to Form2. It has been recommended to me to use a
Cache but I don't know where to begin. I know how to add
the data to a cache, but how do I access it from the
second page?

Any help is greatly appreciated.

Thank you,

Brian Smith

Nov 17 '05 #2
I forgot to add...

....that is to say if you don't want to use the Session object...
"Wim Hollebrandse" <wimATwimdows.com> wrote in message
news:OR*************@tk2msftngp13.phx.gbl...
It wouldn't make sense to add the items to the cache unless your data is the same throughout your web app, ie. not user session specific.

You might want to use the Context object (which is a Page property) and add your items to it using:

Context.Items.Add("dr1",drMyDataRow);

Follow this up with a Server.Transfer("page2.aspx"); and you will be able to retrieve the Items from the Context object again.

This is a very effective way of passing data between ASP.NET pages.

Hope that helps.

Cheers,
Wim Hollebrandse
http://www.wimdows.com
http://www.wimdows.net

"Brian Smith" <sm****@mantech-wva.com> wrote in message
news:08****************************@phx.gbl...
I have a .aspx page (we'll call it Form1) with a
datagrid on it. The datagrid is populated from a dataset
that I manually entered data into (the data isn't in a
database). The datagrid on Form1 also has a button column
on it.
I have another .aspx page (Form2) with an
unpopulated datagrid on it. I want to populate it with
all the columns from the row where the button was clicked
on Form1.
I know how to do what I want with the datagrid
formatting. I know how to open the second page with
javascript. I just don't know how to pass the row from
Form1 to Form2. It has been recommended to me to use a
Cache but I don't know where to begin. I know how to add
the data to a cache, but how do I access it from the
second page?

Any help is greatly appreciated.

Thank you,

Brian Smith


Nov 17 '05 #3
I think the problem your recommended solution may be that he isn't using
Server.Transfer or even Response.Redirect. If I'm understanding his
approach correctly, he is having the client page Form1 open the second page
without going back to the server first.

If this data is fairly static (seems to be implied since it isn't a
database), then I would suggest in opening the second page you simply pass
back, in the query string, some value from a hidden field that identifies
that selected row and its corresponding data.

Todd Thompson
Nov 17 '05 #4

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

Similar topics

2
4752
by: Bill | last post by:
Can anyone tell me the best way to pass form entries from one page to the other just using javascript? The only ways I've found are coockies or using hidden fields to store the data and passing...
10
2447
by: vbMark | last post by:
Hello, I am doing this: window.location="page2.php?subj="+subj+"&body="+body; to send information to another page. However, I don't want that second page to show up or display in any way....
3
4736
by: Simon Harvey | last post by:
Hi, In my application I get lots of different sorts of information from databases. As such, a lot of information is stored in DataSets and DataTable objects. Up until now, I have been passing...
3
2702
by: Evan | last post by:
I have a web page with 2 frames. The left frame is running menu.aspx and the right frame is running images.aspx. When a selection is made in menu.aspx I call a method in images.aspx and pass a...
3
3656
by: Lonewolf | last post by:
Hi all, I'm having difficulties passing data back to managed class from my native class when the data is generated from within a native thread in the native class itself. I will give the following...
10
1431
by: Vik | last post by:
From a Web page, I need to open another page created in another project and pass some object (a database connetion) to that page. Looks like the second project has its own Application and Session...
4
2121
by: Andreas Pfiz | last post by:
Hello, I have a problem with passing Data between a "classic ASP-Page (VBScript)" and a ASP.NET 2.0 Page using showModalDialog / window.returnValue...
2
1522
by: mrjoka | last post by:
hi guys, i'm building a web site where i have a lot of pages, in the default page i'm having a menu in this menu i have a callendar a drop down list, in the callendar i need to remember the date...
4
4149
by: moondaddy | last post by:
I have a htm page where I need to pass some data to an aspx page as a means of sending data to the database. I don't need to see the aspx page so I was going to put it in a hidden iframe. This...
0
7202
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7086
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
7280
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
7460
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...
0
3167
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3154
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1512
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
736
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
380
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.