Hi people,
Though i know basics of the asp.net, im new to deeper consepts of asp.net programming, so please forgive me if i am making big mistake here.
Im having errors in my page related to static members being passed between requests.
I have custom web control(myControl) that has a static array of "myControl" objects. On the init event of the control, it inserts itself into the static array, indexed with its ID property. So because of the bahavior of static members in asp.net sometims the list passes between requests and gives "Key already exists" error.
So in short i need a way to store the list in a way, its seperate in very request. I figures it can be done using httpContext.Current.Items property. Here is my code:
protected void MyControl_Init()
{
if(HttpContext.Current.Items["myControlList"] == null)
{
HttpContext.Current.Items["myControlList"] = new Dictionary<string,MyControl>();
}
((Dictionary<s ...
Go to the complete details ...