473,651 Members | 2,635 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,...Ther e 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 =
(myclasstypeher e)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_It em' 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 1256
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.t amu.edu> wrote in message
news:#W******** ******@TK2MSFTN GP09.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,...Ther e 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 =
(myclasstypeher e)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_It em' 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******@takem pis.com> wrote in message
news:uV******** ******@TK2MSFTN GP12.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.t amu.edu> wrote in message
news:#W******** ******@TK2MSFTN GP09.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,...Ther e 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 =
(myclasstypeher e)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_It em' 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
2075
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 to get a working system just about finished. I am building an interface for our customer service folks to use to manage registered customers and am seeing some weird behavior.
1
1307
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 the same code running in several different environments, it just so happens this is the production server we're having problems with. Not ideal, typically. What happens is this.
3
1500
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. However, each entry starts with the following: The description for Event ID ( 0 ) in Source ( <<appname>> ) cannot be found. The local computer may not have the necessary registry
1
1196
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 windows service), the method works fine. However, when we execute it from ASP.NET, the execution fails on some machines. Now, if instead of running the batch file directly, I run cmd.exe and have it run the batch file: cmd /k platformupgrade.bat
2
1275
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 at the following codes. Nothing special about it. Please help!! Bill Private Sub dtPicker1_ValueChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles dPicker1.ValueChanged
14
2955
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 @ 2000 (INI file) and
2
1045
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 even though the form is inheritting (Inherits System.Windows.Forms.Form) . I was under the impression that have this I would have access to listitem type of object. Could I be missing another reference? This never happens in my asp.net apps and...
1
1433
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 do or add. (issue 1) When setting up a panel control with border settings: <asp:Panel Backcolor="BurlyWood" Borderstyle="Ridge" BorderColor="Black" BorderWidth="1px" ... Runat="server" />
10
2155
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
3365
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. And its main role is just to read a big xml file and save each object into its embedded DB(such as gdbm).
0
8349
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8275
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8795
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8695
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8576
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7296
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5609
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4281
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1906
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.