473,503 Members | 1,691 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Weird Dotnet Issue

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

Nov 18 '05 #1
2 1249
Apparently, when you are assigning myObject to Session["utility"], it is not
initialized, and is null. Either that, or the Session data is being lost
somehow (not likely).

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Hai Nguyen" <ha******@neo.tamu.edu> wrote in message
news:#W**************@TK2MSFTNGP09.phx.gbl...
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

Nov 18 '05 #2
When I debugged, that object apprantely had a value. I don't know why after
postback it seemed the Session was swept out

Appreciate any suggestions

Thanks
"Kevin Spencer" <ks******@takempis.com> wrote in message
news:uV**************@TK2MSFTNGP12.phx.gbl...
Apparently, when you are assigning myObject to Session["utility"], it is not initialized, and is null. Either that, or the Session data is being lost
somehow (not likely).

--
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Hai Nguyen" <ha******@neo.tamu.edu> wrote in message
news:#W**************@TK2MSFTNGP09.phx.gbl...
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


Nov 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
2068
by: redneck_kiwi | last post by:
Hi all: I have a really weird problem. I am developing a customer catalog system for my company and as such have delved into sessions for authentication and access levels. So far, I have managed...
1
1293
by: C. Woody Butler | last post by:
I have a strange problem with a website and a web service. They're both on the same server, running Windows server 2003. The website is set up as the default website for the server. I've got...
3
1487
by: bas jaburg | last post by:
Hi, I am using the Microsoft Application BuildingBolock (Freudian slip, hahaha) Exception Management and am using a CustomPublisher. This goes fine and it write's stuff the Windows EventLog. ...
1
1188
by: Bill Rapoza | last post by:
We have a method that executes an arbitrary batch file (we use it for remote upgrades of our system). When we execute this method from outside of ASP.NET (either in the foreground app or from a...
2
1268
by: Bill Nguyen | last post by:
Every time I jumped to a new month, the app kept popping up the message box for subsequent months until 2050! If I stayed within the same month (current month), it worked fine. Please take a look...
14
2932
by: Nak | last post by:
Hi there, It's probably me being weird more than the function but I'm having problems with it doing as it should. I have a C++ application with 2 resources of custom types, RT_INIFILE @...
2
1032
by: Joe Van Meer | last post by:
Hi All, I have begun a small app (exe) that contains a listbox. When I go to manipulate it in code, say a loop through all the listitems in the listbox it says that my ListItem is not declared...
1
1425
by: Mark Denardo | last post by:
I recently upgraded to VS2005 and converted some projects from 1.1 to 2.0 and am seeing two weird behaviors I can't seem to resolve, and am wondering if they are bugs or something I'm forgetting to...
10
2147
by: alsmeirelles | last post by:
Hi all, I Have run this test: Private Sub test() Dim d As Double Dim f As Single Dim output As String d = 8888888888888.8887
6
3353
by: itsolution | last post by:
Hi folks, Could you shed some light on this issue? my program is running on Freebsd as a daemon. When user sends a request, it forks itself and lets its child process handles the request....
0
7202
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7278
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7328
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6991
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7458
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5013
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3167
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3154
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
380
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.