Tuesday, March 29, 2005

Sending arrayList using Profile object in Asp.net 2.0

Profile object is really cool in Asp.net 2.0 in which you can place anything about the user.

You can even place an arrayList inside the Profile object something like this:


System.Collections.ArrayList aList = new System.Collections.ArrayList();
aList.Add("Azam");
aList.Add("John");
aList.Add("Saif");
Profile["Name"] = aList;


Don't forget to add a type attribute in your web.config so that Asp.net will know the type of object you are putting inside the Profile object.



name="Name"
type="System.Collections.ArrayList"
defaultValue="??"
allowAnonymous="true" />



if you don't specify the type object you will get an error.

No comments: