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

Store Dictionary Object in Session not working

HI

Can someone tell me what is wrong with this? The first 'if' condition works
but the 'else' condition seems to get the right Count but the contents of
the key and items are lost.
Set dic_qs = CreateObject("Scripting.Dictionary")

If Request.QueryString("new") = "1" Then
Set Session("search_qs") = Request.QueryString()
Set dic_qs = Session("search_qs")
Else
If TypeName(Session("search_qs")) = "IRequestDictionary" Then
Set dic_qs = Session("search_qs")

Response.Write dic_qs.count

End If
End If
Many thanks
Andrew
Feb 15 '07 #1
2 6244
J055 wrote:
HI

Can someone tell me what is wrong with this? The first 'if' condition
works but the 'else' condition seems to get the right Count but the
contents of the key and items are lost.
Set dic_qs = CreateObject("Scripting.Dictionary")

If Request.QueryString("new") = "1" Then
Set Session("search_qs") = Request.QueryString()
Set dic_qs = Session("search_qs")
Else
If TypeName(Session("search_qs")) = "IRequestDictionary" Then
Set dic_qs = Session("search_qs")

Response.Write dic_qs.count

End If
End If
It's a good thing you can't get it to work. Storing a Dictionary object
in Session or Application is one of the best ways to kill web
application performance and is definitely not recommended. You need to
come up with another strategy, perhaps a free-threaded xml document.

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Feb 15 '07 #2
Hi Bob

That's quite sad. An alternative method is quite a bit more work.

Oh well
Thanks anyway

Andrew
Feb 15 '07 #3

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

Similar topics

8
by: Rodd Snook | last post by:
I have an application which makes extensive use of the Scripting.Dictionary object. I'm not doing anything silly like putting them outside the page scope -- just creating quite a few of them and...
5
by: TWiSTeD ViBE | last post by:
Hi, While pouring over some code I've discovered a previous developer heavily uses the "dictionary" object. Whilst I see some of the advantages of using this system It's something I've not used...
5
by: Fox | last post by:
Hi, I am working on a project which used dictionaries. I am having to remake part of this and have no experience with the scripting dictionary. I need to see how to create multiple...
3
by: Martin | last post by:
Dear fellow ASP.NET programmer, I stared using forms authentication and temporarily used a <credentials> tag in web.config. After I got it working I realized this wasn't really practical. I...
0
by: Michael O'Brien | last post by:
I'm trying to hook in a specialized state store server into ASP.NET. I understand I can create a HttpModule and hook the events OnAcquireState and OnReleaseState. So far so good. But, it seems...
11
by: john_c | last post by:
I'd like to store information for roles in Session variables. RoleA has a specific set of values, RoleB has a specific set and so one. When I access values for RoleA, it looks like this: ...
4
by: Mark S. | last post by:
Hello, I have a series of changing string IDs that are loaded dynamically a couple times a minute. I need to associate each ID with a different static class so later on in the app's lifecycle it...
4
AnuSumesh
by: AnuSumesh | last post by:
Hi I want that if user is logged in on one machine and trying to log in another machine also then he should not be allowed to log in again. For that-- i am creating Dictionary object on...
2
by: Andy B | last post by:
I don't know if this is even working or not but here is the problem. I have a gridview that I databound to a dictionary<string, stringcollection: Contract StockContract = new Contract();...
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: 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
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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...

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.