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

How to convert NameValue Collection when using ViewState

Hi,

I am trying to store a NameValue collection within a ViewState like this:
StoreFilterSelection = ViewState["StoreFilterSelection"];

YEt I recieve an error "Cannot implicityly convert type 'system.type' to
'system.collections.specialized.nameValueCollectio n".

Can I store a NameValuecollection in a viewstate and how can I read what is
save in this collection so I can update it from page to page.

Jul 21 '05 #1
2 5210
Hi,
Assign the collection directly to the view state as in
ViewState["StoreFilterSelection"] = StoreFilterSelection;

While retrieving it, typecast explicitly:
StoreFilterSelection =
(NameValueCollection)(ViewState["StoreFilterSelection"]);

HTH.

"Nicole - ASP/C# Beginner" <Ni****************@discussions.microsoft.com>
wrote in message news:61**********************************@microsof t.com...
Hi,

I am trying to store a NameValue collection within a ViewState like this:
StoreFilterSelection = ViewState["StoreFilterSelection"];

YEt I recieve an error "Cannot implicityly convert type 'system.type' to
'system.collections.specialized.nameValueCollectio n".

Can I store a NameValuecollection in a viewstate and how can I read what is
save in this collection so I can update it from page to page.
Jul 21 '05 #2
thank you

"Shiva" wrote:
Hi,
Assign the collection directly to the view state as in
ViewState["StoreFilterSelection"] = StoreFilterSelection;

While retrieving it, typecast explicitly:
StoreFilterSelection =
(NameValueCollection)(ViewState["StoreFilterSelection"]);

HTH.

"Nicole - ASP/C# Beginner" <Ni****************@discussions.microsoft.com>
wrote in message news:61**********************************@microsof t.com...
Hi,

I am trying to store a NameValue collection within a ViewState like this:
StoreFilterSelection = ViewState["StoreFilterSelection"];

YEt I recieve an error "Cannot implicityly convert type 'system.type' to
'system.collections.specialized.nameValueCollectio n".

Can I store a NameValuecollection in a viewstate and how can I read what is
save in this collection so I can update it from page to page.

Jul 21 '05 #3

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

Similar topics

2
by: Peter Kwan | last post by:
Hi, I believe I have discovered a bug in Python 2.3. Could anyone suggest a get around? When I tested my existing Python code with the newly released Python 2.3, I get the following warning: ...
6
by: Mel | last post by:
I have a large collection of custom objects, each representing a period in time with each having a start datetime and an end datetime. I frequently need to query this collection to return a subset...
1
by: igitur | last post by:
Hi all, I have a custom collection derived from System.Collections.Specialized.NameObjectCollectionBase. NameObjectCollectionBase already implements ISerializable, so it should be easy to...
10
by: GP | last post by:
Is it possible to iterate through all the controls collection and make the textboxes alone as read only.I don't see a readonly property for the Control.Can some one help me in this context? I...
2
by: raffe | last post by:
Hi all! I have a control which represents a user record in my database and a save button. It get's loaded into a placeholder and all the controls like TextBox get bound to the data source. At...
4
by: Islamegy® | last post by:
In my EntityCollection inherted from CollectionBase I marked it and Implement ISerializable Interface.. here is the code.. GetObjectDate( .....)...
2
by: Nicole - ASP/C# Beginner | last post by:
Hi, I am trying to store a NameValue collection within a ViewState like this: StoreFilterSelection = ViewState; YEt I recieve an error "Cannot implicityly convert type 'system.type' to...
1
by: parag.gadkari | last post by:
Can a name value collection be serialized as attributes to the Xml element of class containing this name value collection? For eg. if a class pControl: public class pControl { ........
0
by: rmgalante | last post by:
Hi, I've been experimenting with the ASP.Net GridView and encountered some interesting issues that I thought I would share. I have a page that loads a GridView with a generic collection of...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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...

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.