473,320 Members | 1,900 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,320 software developers and data experts.

retrieving data from the last pageS

Hi!
I have a little problem... I have 3 pages:
users should go from page1 to page2 and then to page3
In page1 there is an arraylist, and I can access it from page2 using
the PreviousPageType directive and a public property in page1.

My problem is: how can I access the arraylist in page1 from page3?
I tried to define a public property in page2 that returns
"previouspage.arraylist" but it doesn't work.
Any idea?

Thank you in advance!!

Giggi

Jan 4 '07 #1
4 1130
Giggi,

Page 1 is available only to Page 2. Page 2 will need to save the info in one
of its properties to make it available to Page 3. It could be easier just to
use session variables that are available to all pages in the application.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
"Giggi" <lu***********@gmail.comwrote in message
news:11*********************@v33g2000cwv.googlegro ups.com...
Hi!
I have a little problem... I have 3 pages:
users should go from page1 to page2 and then to page3
In page1 there is an arraylist, and I can access it from page2 using
the PreviousPageType directive and a public property in page1.

My problem is: how can I access the arraylist in page1 from page3?
I tried to define a public property in page2 that returns
"previouspage.arraylist" but it doesn't work.
Any idea?

Thank you in advance!!

Giggi

Jan 4 '07 #2
Hi,

Giggi wrote:
Hi!
I have a little problem... I have 3 pages:
users should go from page1 to page2 and then to page3
In page1 there is an arraylist, and I can access it from page2 using
the PreviousPageType directive and a public property in page1.

My problem is: how can I access the arraylist in page1 from page3?
I tried to define a public property in page2 that returns
"previouspage.arraylist" but it doesn't work.
Any idea?

Thank you in advance!!

Giggi
Note that the pages are only instantiated when the request is active,
and they are recycled after the response is sent. If your arraylist must
be accessible from other objects, you should define it static (but then
be careful for possible memory leaks).

Once the static arraylist exists, you can access it with

Page1.MyStaticArrayList

If you cannot define it static, then you must create a instance of Page1
before using the property, but I would try to avoid this. If this must
really be an instance property, I would rather export the ArrayList to
an external object used by Page1 and Page3.

HTH,
Laurent
--
Laurent Bugnion [MVP ASP.NET]
Software engineering: http://www.galasoft-LB.ch
PhotoAlbum: http://www.galasoft-LB.ch/pictures
Support children in Calcutta: http://www.calcutta-espoir.ch
Jan 4 '07 #3
I wouldn't rcommend using static variables as the data is probably session
specific. I'd also store the info in the Session.

"Laurent Bugnion [MVP]" <ga*********@bluewin.chwrote in message
news:u3****************@TK2MSFTNGP04.phx.gbl...
Hi,

Giggi wrote:
>Hi!
I have a little problem... I have 3 pages:
users should go from page1 to page2 and then to page3
In page1 there is an arraylist, and I can access it from page2 using
the PreviousPageType directive and a public property in page1.

My problem is: how can I access the arraylist in page1 from page3?
I tried to define a public property in page2 that returns
"previouspage.arraylist" but it doesn't work.
Any idea?

Thank you in advance!!

Giggi

Note that the pages are only instantiated when the request is active, and
they are recycled after the response is sent. If your arraylist must be
accessible from other objects, you should define it static (but then be
careful for possible memory leaks).

Once the static arraylist exists, you can access it with

Page1.MyStaticArrayList

If you cannot define it static, then you must create a instance of Page1
before using the property, but I would try to avoid this. If this must
really be an instance property, I would rather export the ArrayList to an
external object used by Page1 and Page3.

HTH,
Laurent
--
Laurent Bugnion [MVP ASP.NET]
Software engineering: http://www.galasoft-LB.ch
PhotoAlbum: http://www.galasoft-LB.ch/pictures
Support children in Calcutta: http://www.calcutta-espoir.ch

Jan 4 '07 #4
Eliyahu Goldin wrote:
Giggi,

Page 1 is available only to Page 2. Page 2 will need to save the info in one
of its properties to make it available to Page 3.
Hi!

Thank you everybody!!
That would be perfect, could you please give a few lines of example?
That's what I have:

----Page1.aspx----
<script runat="server">
Public ReadOnly Property dest() As ArrayList
Get
Dim dest_list As New ArrayList
...'takes data from some checkboxes selected on the page
Return dest_list
End Get
End Property
</script>

----Page2.aspx----
<script runat="server">
Protected Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArgs)
'gets array from previous page
Dim dest_list As ArrayList = PreviousPage.dest() '<-- doesn't
work when called by Page3!!!
End Sub

Public ReadOnly Property get_dest() As ArrayList
'returns array to the next page
Get
Return dest_list '<--- this is out of scope!!
End Get
End Property
</script>

----Page3.aspx----
....
Dim destinatari As ArrayList = PreviousPage.get_dest()

Jan 4 '07 #5

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

Similar topics

2
by: Boban Dragojlovic | last post by:
I'm building a complex web-based reservations system. Gathering the user's data requires between 8 and 15 pages (depending on which options they are interested in). I use the "Session" object to...
6
by: Ian Williamson | last post by:
Greetings, My company has an ASP.NET based enterprise product that is undergoing some changes and I need some community input to help solve a problem. In the current implementation, any given...
1
by: antonyliu2002 | last post by:
This message was originally a follow-up in a thread, but it went ignored and I do want some help so I am initiating it as a new topic. After Patrick and Karl showed me some examples, I was trying...
7
by: Sirplaya | last post by:
I am retrieving images that I stored in SQL Server on my web pages in C#. I have no problem with the images displaying, however, I am trying to wrap the image with an <A HREF ..." and each time I...
5
by: Sanjay Pais | last post by:
I have a table with over 1.3 million rows. I am retrieving only 20 at a time using the with - over clauses In query analyser, the data is retrieved in under a second. When retrieving using the...
3
by: ajos | last post by:
Hello friends, In my action class i am getting a resultset data which im storing in a arraylist. In my jsp page im retrieving the arraylist data as-----> <%publicity.PendingReqForm prfObj=null;...
9
ADezii
by: ADezii | last post by:
One question which pops up frequently here at TheScripts is: 'How do I retrieve data from a Recordset once I've created it?' One very efficient, and not that often used approach, is the GetRows()...
3
ADezii
by: ADezii | last post by:
Last Tip, we demonstrated the technique for retrieving data from a DAO Recordset, and placing it into a 2-dimensional Array using the GetRows() Method. This week, we will cover the same exact Method...
3
AaronL
by: AaronL | last post by:
Hello, I am currently working on a project that has me in sort of a bind. What I want to do is retrieve web pages from the internet, and strip them down to just text. I'll get using Regular...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.