473,404 Members | 2,174 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,404 software developers and data experts.

Why my session used in another page is empty?

5
On the Default.aspx
Expand|Select|Wrap|Line Numbers
  1. Dim i As Integer
  2.         Dim array1 As ArrayList = New ArrayList()
  3.         For i = 0 To cbBrand.Items.Count - 1
  4.             If cbBrand.Items(i).Selected Then
  5.                 array1.Add(cbBrand.Items(i).Value)
  6.             End If
  7.         Next
  8.         Session("array2") = array1
  9.         Dim city As ArrayList = CType(Session.Item("array2"), ArrayList)
  10.         For i = 0 To city.Count - 1
  11.             Label1.Text += city(i)
  12.         Next
  13.  
On the Email2.aspx.cs
Expand|Select|Wrap|Line Numbers
  1.  
  2. ArrayList array3 = (ArrayList)Session["array2"];
  3.             for (int i = 0; i < array3.Count; i++)
  4.             {
  5.                 Label1.Text += array3[i];
  6.             }
  7.  
There is no value in the array3 in the Email2.aspx.cs
Aug 12 '10 #1
1 1068
Frinavale
9,735 Expert Mod 8TB
Looks you have 2 different asp.net web applications here: one is in VB.NET and the other is in C#. Session does not span across different applications. You could try changing your Session to be something where both applications have access to the same data. See this article on Session for more information on the different types of session that you can use.

-Frinny
Aug 12 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: | last post by:
What could the likely cause of a session value being lost when one navigates to another page and attempts to write that session out: Page 1 session("u_name") = oRS.fields("u_name") Navigate...
6
by: anon | last post by:
Post Forwarding question...... For this control below, <asp:Button runat="server" PostTargetUrl="page2.aspx" /> The Attribute: PostTargetUrl="page2.aspx" Is this PostTargetUrl Attribute...
0
by: nik | last post by:
I have a postback on an aspx-page. In this postback I perform a redirect. The page is quite heavy, so instead of performing a postback I perform a post to another empty page, which then can do the...
3
by: Peter Theill | last post by:
Hi, I'm trying to include the content of a request into an Xml document: if (System.Web.HttpContext.Current.Session != null) { XmlDocument d = new XmlDocument(); d.Load(new...
17
by: Rabbit | last post by:
Hi, On my 1st page, i have a function which gets a new ID value and need to transfer to another immediately. which I want to get in 2nd page using Request.form("txtID"), but doesn't work, the...
3
by: Carlos | last post by:
Hi all, I would like to know what is the most efficient way to redirect a gridview containing data to another page. It is kind of confirming an order which just needs to be re-displayed. Can...
2
by: ronchese | last post by:
I'm noticing this since I started developing a website project: my session variables are getting empty! I did a real easy test, and I checked my session variable is getting empty!! What is...
3
abdoelmasry
by: abdoelmasry | last post by:
Hi Friends i need help in sessions im passing variables between pages using sessions this is the main page thats mean the home page the main page have table to show messages for users , it have...
1
by: slavisa | last post by:
Hi, i have a form and i use cgi script to email the results back to me. I have a javascript in there already that checks if the required fields are filled when you click submit and if they are not...
2
by: Astrix | last post by:
I have been working on session timeout for an application and I got a lot of help from this discussion Board. My Thanks to all of you. For e.g If i have a website which has multiple pages, I...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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
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
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.