473,698 Members | 2,574 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Session State and debugging the code behind

I'm writing a shopping cart in vb.net and for the first time I'm working
with session state on the server. I'm using it to maintain the user's
shopping cart for the session. in the browser is a datagrid with a listing
of products. If I put a break point in the code behind the code execution
will break at that point just as you would expect. When the user clicks on
an item in the grid it executes a line of jscript listed below which posts
the item to the shopping cart:
parent.data.fra meElement.src=" data.aspx?Task= CartAddNew&sku= " + sku;

However, this only works correctly the first time a grid item is clicked on.
if the user clicks on any of the previous clicked on items the line above
will run and I can see the shopping cart summary update in the page (which
means that the code behind is executing), but none of the code behind will
break on the break points. This only started happening after I started
using session state on the back end. Is it possible that session state is
causing this and do you have any ideas on how to begin trouble shooting
this? Its like a ghost I can't identify.

Thanks.
--
mo*******@nospa m.com
Nov 18 '05 #1
3 1556
Hello,

Thank you for using the community. From the description, it is hard to tell
if this problem is related to the session. More source code may provide
useful detail information about the problem.

Generally, when the script is executed, the page will be refresh and code
in Form_Load will be executed. You may set a break point at the beginning
of this sub to see if it will be executed, or you can add some debug code
like:

Response.Write "Here has been executed"

This will indicate if a sub has been executed.

Additionally, since it work in the first time, but failed later, you may
check the client source code to see if there is any difference between them.

Luke
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Nov 18 '05 #2
I already tried your suggestion by putting alerts in the jscript which
flagged where the code was executing. I also but numerous break points
through out the code behind. All code was in fact executing because the
code behind was recalculating the shopping cart total with each postback,
but the code behind stopped breaking on the break points once I clicked on a
shopping cart item for the 2nd time. Since this is running in a frames
page, could that have anything to do with this? I wouldn't thing so because
all shopping cart functionality happens via a hidden frame and an aspx page
called data.aspx (meaning that i'm not using various frames and or pages to
make the round trips).

--
mo*******@nospa m.com
"[MSFT]" <lu******@onlin e.microsoft.com > wrote in message
news:Nq******** ******@cpmsftng xa06.phx.gbl...
Hello,

Thank you for using the community. From the description, it is hard to tell if this problem is related to the session. More source code may provide
useful detail information about the problem.

Generally, when the script is executed, the page will be refresh and code
in Form_Load will be executed. You may set a break point at the beginning
of this sub to see if it will be executed, or you can add some debug code
like:

Response.Write "Here has been executed"

This will indicate if a sub has been executed.

Additionally, since it work in the first time, but failed later, you may
check the client source code to see if there is any difference between them.
Luke
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Nov 18 '05 #3
If you right click in the frame and select "Refresh", will the break
points get fired? Also, as I suggest, add some code in the code behind like:

Response.Write "Here has been executed"

Have you seen the line "Here has been executed" after click the item for
second time?

Luke
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Nov 18 '05 #4

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

Similar topics

9
2383
by: Greg Linwood | last post by:
I'm having difficulty understanding Session state in ASP.Net. It's almost embarrassing asking this as I've been using ASP since it was first released & it really shouldn't be this hard to use - perhaps I'm just not very smart or perhaps MS is making this too hard for us sql bunnies to understand - I dunno, but I'd really appreciate someone explaining what I'm doing wrong here & perhaps suggest a better approach.. I'm familiar with use of...
5
1532
by: Arun | last post by:
Hi, Is it possible to share Session/Application State across different Asp.net webapplication (one in VB.net ) and the other is C# ? If so can you guide me ? -Regards' Arun
0
1628
by: Nabani Silva | last post by:
Hi, hope someone could help I need to share session state (and contents) through differente web applications. I'm trying to get it done by using StateServer session state, below I paste code for web.config. Both applications are on the same server (I don't want to include all applications into one common virtual directory or application)
6
3852
by: coconet | last post by:
Using ASP.NET 2.0, I want to use the code-behind to disable session state (eg I do not want to put anything in the .aspx page template). I also do not want to touch web.config. How can I do this? Thanks.
0
8683
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
8610
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
8873
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
7740
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...
1
6528
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5862
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
4623
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3052
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2339
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.