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

State Management

I want to know how to use Session State or View State in an app.

I have a check box that determines if a dropdown list needs to be enabled or not. Here is the simple code...

Expand|Select|Wrap|Line Numbers
  1.  
  2. If chkReserved.Checked = True Then
  3.  
  4.                ddlFillStart.Enabled = False
  5.                ddlFillEnd.Enabled = False
  6. Else 
  7.                ddlFillStart.Enabled = True
  8.                ddlFillEnd.Enabled = True
  9.  
  10.  
This happens the first time around but not after a postback. Also, specifying Postback action in the code (If Not IsPostback) does not make a difference. I understand this is a sessions issue. Looking for advice on my try...

Sessions("Reserved") = chkReserved.Checked
chkReserved.Checked = Session("Reserved")

Is this declaration good enough or do I have to create another Class to call the Session to refer to the new class?

Your help is appreciated.

Phoenix
Oct 14 '07 #1
2 1004
jhardman
3,406 Expert 2GB
Pheonix,

Please use code tags in the future, notice the button marked - # -.

Also, I am moving your question to the .NET forum. Although there is a lot of overlap and a lot of ASP experts can answer either type of question, site administrators have asked that questions specifically about ASP.NET be moved to the .NET forum.

Jared
Oct 16 '07 #2
Frinavale
9,735 Expert Mod 8TB
I want to know how to use Session State or View State in an app.

I have a check box that determines if a dropdown list needs to be enabled or not. Here is the simple code...

Expand|Select|Wrap|Line Numbers
  1.  
  2. If chkReserved.Checked = True Then
  3.  
  4.                ddlFillStart.Enabled = False
  5.                ddlFillEnd.Enabled = False
  6. Else 
  7.                ddlFillStart.Enabled = True
  8.                ddlFillEnd.Enabled = True
  9.  
  10.  
This happens the first time around but not after a postback. Also, specifying Postback action in the code (If Not IsPostback) does not make a difference. I understand this is a sessions issue. Looking for advice on my try...

Sessions("Reserved") = chkReserved.Checked
chkReserved.Checked = Session("Reserved")

Is this declaration good enough or do I have to create another Class to call the Session to refer to the new class?

Your help is appreciated.

Phoenix
For more information on Sessions see Sessions-How to pass information between web pages.

Since it doesn't appear that you are going to require this information in another web page, I'd suggest using ViewState to store your boolean.

Is this declaration good enough or do I have to create another Class to call the Session to refer to the new class?
I'm not sure what you mean by this?


-Frinny
Oct 16 '07 #3

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

Similar topics

4
by: Chad Crowder | last post by:
I've taken a look at this article http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnaspnet/html/asp12282000.asp which someone posted a month or so ago regarding setting up SQL...
2
by: John A Grandy | last post by:
for high traffic public websites , what are the proven options for session-state storage & management ? is an out-of-process state-server generally preferred over a sql-server ? what are the...
1
by: John Grandy | last post by:
Could someone point me in the direction of good discussions on scalable state management solutions? Specifically, pros and cons of following strategies: Strategy 1 : temporary business-objects...
2
by: geodev | last post by:
Hello, I’m currently writing an asp.net application that will be running on a Windows XP Professional workstation utilising IIS and MSDE Database. At a later date this application will need to...
13
by: James Hunter Ross | last post by:
We love the ASP.NET "Session" concept and make good use of it. But, getting close to deployment we find we lose sessions far too often, probably due to application restarts, etc. We hope to...
0
by: Shell | last post by:
Hi All, We have an application that uses SQL Server 2000 for State Management data. We previously use to build and deploy this application using ASP.NET Beta 2 version. Now we are using ASP.NET...
5
by: knyghtfyre | last post by:
Hello, My company is developing a rather large application with .NET 2.0. We are expanding to a server farm and are in the process of converting our application to use an out-of-process session...
4
by: =?Utf-8?B?Z3V5?= | last post by:
Is this a valid approach to State Management? What I do is define a class 'State' which holds all the objects etc. that I need to store in the Session. I can then get my state object and...
0
by: kirk | last post by:
I have three events that I have created and manage with timers. Two of the timer event handlers, the last two in the code below, need to reset state management data, if the first event handler...
1
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...

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.