473,657 Members | 3,041 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Session State in User Controls in Wizard Control

I have a wizard control that has a varying number of steps.
Each step utilizes different custom business objects and populates
values.
The steps are partially determined at the beginning of the wizard.
Imagine a reporting wizard where you grab all of the parameters for a
report.

So, each of the steps are in a separate user control. The user control
loads the appropriate objects from session controlled by properties on
the control similar to this:
public ReportManager Manager
{
get
{
ReportManager manager = null;
try
{
manager = (ReportManager) Session["Manager"];
}
catch { }
if (manager != null)
return (ReportManager) manager;
else
return null;
}
set
{
Session["Manager"] = value;

}
}

The problem that I am having is that when I get to the Summary page,
all of my variables that have been put into session state are null (or
empty). Even simple bool or string variables.

Session is set to inproc, 20 min, and when stepping through the code,
I see the values being populated. It is like when it goes to the next
step, the session goes away. There is no app pool recycle or things
like that going on.

I do notice that the summary control get's loaded on each and every
step. I don;t know why that would cause any issue though.

I know this is a little hard without seeing the code, but it would be
a lot. On each control, I set the OnInit() to
Page.RequiresCo ntrolState(this );
base.OnInit(e);
and
protected override void OnUnload(EventA rgs e)
{
SaveViewState() ;
SaveControlStat e();
base.OnUnload(e );
}
to make sure that some other state issues happen correctly.
These are .ascx User controls.

I am looking for overall suggestions on how to handle this. I have
thought about refactoring to move all of the different BO and props
into a single object and load/save that out. I have even thought about
serializing this out to a DB or using SQLSessionState , but those are
all a lot of work, and of course, not a lotta time.

Anyone care to offer suggestions ?

Oct 5 '07 #1
0 1465

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

Similar topics

14
2255
by: Venkat Chellam | last post by:
I have a peculiar problem. I have a simple web application which loads some data from the oracle table and display in the datagrid in the webpage and datagrid has page enabled which shows 10 rows at a page.I have a search criteria to search the records based on the data range i give This is what i have done, in the !IsPostBack section. I am setting up the oracle connection, creating dataset object, datadapter and i aslo load the data...
13
5241
by: Leszek Taratuta | last post by:
Hello, I have several drop-down lists on my ASP.NET page. I need to keep data sources of these lists in Session State. What would be the most effective method to serialize this kind of data structures? Thanks for any hints, Leszek Taratuta
1
2960
by: SteveComplex | last post by:
I'm currently working on a project developing a web application that makes heavy use of 3rd-party controls, popup windows and frames ( not my design I hasten to add ). Some of the pages make use of several user controls embedded in a tab control. Needless to say that the page size can be somewhat on the large size, including a lot of information being stored in viewstate. I'm currently looking for a solution to resolve the problem of...
1
936
by: Dave | last post by:
I have a series of User Controls that I swap in and out of my Main Form. How do I access the collection of User Controls (each control may or may not be instantiated at any given time)?
2
1357
by: jeff_m | last post by:
Hello, I'm having some trouble with a combination of these elements: the Session state, a Repeater control, a TreeView control, and a button. Here's the process: - User logs in (loginid stored in session state) - User presses a button (to delete a node from the TreeView) - I re-bind the TreeView and the Repeater to reflect changes made by
4
6849
by: Dabbler | last post by:
I have a Wizard control with each step using a user control. It seems the page_load of each user control is called everytime a postback event occurs in any step. Is there away to communicate to a user control that is it now the current "page" so I can restrict some of the initialization to occur only when the step is visible? I have a couple of controls that hit the database and don't want the overhead if the use isn't even looking at that...
8
3176
by: mark.norgate | last post by:
I've run into a few problems trying to use generics for user controls (classes derived from UserControl). I'm using the Web Application model rather than the Web Site model. The first problem I'm having is that the partial class signature in my projectDetails.ascx.cs file looks like this: public partial class ProjectDetailsControl<TEntryServiceProvider: UserControl, INamingContainer where TEntryServiceProvider : IEntryServiceProvider...
12
2589
by: raghav | last post by:
Hi I am working on ASP.NET 2.0. I am developing a website using Wizard control. Based on number of steps added, next, previous, finish buttons generate automatically. After running the application, these button work automatically, means we can go to next step, previous step by clicking on corresponding buttons. In my application I have 3 steps. On Next button click of step 1, I want two things to happen. One is inserting data of step 1 in...
0
1266
by: Larry R | last post by:
I am having a problem with saving some state between user controls.I know that it is a event/lifecyclye thing, but can;t quite find the right event. Here is the setup: I have a Customer BO that is stored in session. There is a wizard that gets the id, loads the Customer, allows changes, then saves. Simple, right? Since the steps in the final project are quite dynamic, I extracted
0
8384
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8302
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8499
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8601
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6162
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5630
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4300
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2726
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 we have to send another system
2
1937
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.