473,378 Members | 1,388 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,378 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 5209
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...
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
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: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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:
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
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...

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.