473,383 Members | 1,789 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

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.frameElement.src="data.aspx?Task=CartA ddNew&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*******@nospam.com
Nov 18 '05 #1
3 1546
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*******@nospam.com
"[MSFT]" <lu******@online.microsoft.com> wrote in message
news:Nq**************@cpmsftngxa06.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
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 -...
5
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
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...
6
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...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.