Strange question

U

unknown

Hi,

I am developing an online book store with shopping cart.
My shopping cart is represented as a Xml server control
and I am using an XSLT to render it at the client side.

I am using an XmlDocument object as session variable to
represent my shopping cart. Initially when the session
starts, I am using the XmlDocument with root and no
elements to show that no items have been added to the
cart.

Once user adds a book, I am taking out the XmlDocument
from session which is my shoppingCart and adding a node
to that XmlDocument with book's details and storing back
the document into the session. But the strange thing
which is happening is, it is adding two nodes of the book
to the XmlDocument instead of a single node. I am using
ImportNode to add a single book node to the XmlDocument.

Now here comes another strange situation. Instead of
trying to develop the cart as XmlDocument, this time I
tried developing the shopping cart as a DataTable and
each time user adds a book, I am adding a new row with
the book to the DataTable session object and displaying
it.

Even in this case, surprisingly shopping cart is showing
2 books instead of a single book.

What can be the reason for this strange behavior. Can
anyone help me in pointing out my mistake?

I would truly appreciate it as I have been cracking my
head on it for several days in a row.

Thanks in advance!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top