Weird Session variable.
-
Hi all I encounter a problem but don't know how to solve it. Here is my situtation: I have a web page, 2 user controls: A and B. A and B are dynamically loaded into the main page. In B there are 4 buttons, TextBox, object and classes,...There is one object I want to save all of its values and I decided to use Session["utility"] = myobject. For the first 3 button, I always remember to assign that object back to the Session for the next use, and it works fine for the first 3 buttons. The last button is a "Save All" button and I also want to retrive that object by: myojbect = (myclasstypehere)Session["utility"]. It breaks my code. Running debug I receive this: myobjec is null and there is a message like this:" Session["utility"] function 'Session.get_Item' evaluated and returned null ". I don't know why it gave me that error. I works with 3 other buttons but not with this. Thanks for any help
-
Hi all I encounter a problem but don't know how to solve it. Here is my situtation: I have a web page, 2 user controls: A and B. A and B are dynamically loaded into the main page. In B there are 4 buttons, TextBox, object and classes,...There is one object I want to save all of its values and I decided to use Session["utility"] = myobject. For the first 3 button, I always remember to assign that object back to the Session for the next use, and it works fine for the first 3 buttons. The last button is a "Save All" button and I also want to retrive that object by: myojbect = (myclasstypehere)Session["utility"]. It breaks my code. Running debug I receive this: myobjec is null and there is a message like this:" Session["utility"] function 'Session.get_Item' evaluated and returned null ". I don't know why it gave me that error. I works with 3 other buttons but not with this. Thanks for any help