Cerebrus
unread,May 13, 2008, 1:08:24 PM5/13/08Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting
IMO, the cast is not valid because :
1. The NVC stores it's keys as strings, not objects.
2. The NVC can store multiple string values per key.
3. There is no direct mapping between a NameValuePair and the
NVC.Item.
You could use a KeyValuePair<T, T> if you were iterating through a
Dictionary object.
Why not simply use something like :
----
StringBuilder retVal = new StringBuilder();
foreach (string key in Session.AllKeys)
{
retVal.Append(key).Append(": ").Append(Session[key].ToString());
}
return retVal.ToString();
----