| | |
Session variables
Please support our ASP.NET advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Sep 2005
Posts: 4
Reputation:
Solved Threads: 0
I wonder if anyone can help with this problem I have
I'm trying to create a shopping cart with session variables, there are 5 buttons on the form and by clicking 1 of these displays the relevant product and price in session variables in textboxes on the next form, the product list is in an XML file, I can load 1 selection fine but can't seem to load the session variables for the other buttons depending on what button is clicked
Does anybody have any tips/advice on how to overcome the problem
Thanks
I'm trying to create a shopping cart with session variables, there are 5 buttons on the form and by clicking 1 of these displays the relevant product and price in session variables in textboxes on the next form, the product list is in an XML file, I can load 1 selection fine but can't seem to load the session variables for the other buttons depending on what button is clicked
Does anybody have any tips/advice on how to overcome the problem
Thanks
I would not recommend using the Session command for storing product related information
I would use the query string
ie. http://www.taylorsnet.co.uk/SourceCo...spx?SourceID=5
So that if a customer bookmarks that page it will forget the session but will still retain the info from the query string
the page can access the query string from Then get the product page to pull the data from the XML file
multiple query strings can be added by separating them by a &
I would use the query string
ie. http://www.taylorsnet.co.uk/SourceCo...spx?SourceID=5
So that if a customer bookmarks that page it will forget the session but will still retain the info from the query string
the page can access the query string from
ASP.NET Syntax (Toggle Plain Text)
request("productid")
multiple query strings can be added by separating them by a &
In this case I would have a common session variable
On first page
On second page
On first page
ASP.NET Syntax (Toggle Plain Text)
public sub button1_click session("Clicked") = "button1" end sub public sub button2_click session("Clicked") = "button2" end sub public sub button3_click session("Clicked") = "button3" end sub
On second page
ASP.NET Syntax (Toggle Plain Text)
public sub page_load if session("Clicked").tostring = "button1" then 'run these sessions elseif session("Clicked").tostring = "button2" then 'run these sessions elseif session("Clicked").tostring = "button3" then 'run these sessions else response.redirect("firstpage.aspx") end if end sub
•
•
Join Date: Sep 2005
Posts: 4
Reputation:
Solved Threads: 0
Thank-you for your help, the products and prices are appearing in the textboxes now, to complete the assignment I need to do the following:
On the order form with the relevant product and price in the textboxes a quantity is entered, when add to basket link is clicked the user is taken to the shopping basket form which is the last form in the application showing the contents of their order, (Description, price, quanity and total) in a datagrid with a text box also showing the order value
The user can then either click place order, this then results in an email being sent with the order details and taken to a conformation page, the basket should then be cleared
The other option is to click carry on shopping, the user is then taken back to the products page and allowed to add further contents to the shopping basket
Any tips/advice on how to approach this would be appreciated, I'm not looking to be spoon fed the answer, just need a guide being new to the language
Thanks
On the order form with the relevant product and price in the textboxes a quantity is entered, when add to basket link is clicked the user is taken to the shopping basket form which is the last form in the application showing the contents of their order, (Description, price, quanity and total) in a datagrid with a text box also showing the order value
The user can then either click place order, this then results in an email being sent with the order details and taken to a conformation page, the basket should then be cleared
The other option is to click carry on shopping, the user is then taken back to the products page and allowed to add further contents to the shopping basket
Any tips/advice on how to approach this would be appreciated, I'm not looking to be spoon fed the answer, just need a guide being new to the language
Thanks
![]() |
Similar Threads
- Using Hidden Variables in ASP.NET (ASP.NET)
- when to use session and cookies variables ? (ASP)
- PHP Session Variables (PHP)
- Session Variables a threat? (VB.NET)
- how can i used session and cookies ??? (PHP)
Other Threads in the ASP.NET Forum
- Previous Thread: Hide Button when DataView is empty
- Next Thread: Create and write a text file that saved in network folder
| Thread Tools | Search this Thread |
.net activexcontrol advice ajax alltypeofvideos appliances asp asp.net bc30451 beginner bottomasp.net box browser button c# cac checkbox click commonfunctions control css dataaccesslayer database datagridview datagridviewcheckbox datalist deadlock deployment development dgv dialog dropdownlist dynamic dynamically edit embeddingactivexcontrol expose fileuploader fill findcontrol flash formatdecimal formview gridview gudi iframe iis javascript listbox login microsoft mono mouse mssql multistepregistration news novell numerical objects opera panelmasterpagebuttoncontrols radio redirect registration relationaldatabases reportemail rotatepage save schoolproject search security sessionvariables silverlight smartcard smoobjects software sql-server sqlserver2005 ssl suse textbox tracking treeview unauthorized validatedate validation vb.net video videos virtualdirectory vista visualstudio web webapplications webdevelopemnt webdevelopment webprogramming webservice xsl youareanotmemberofthedebuggerusers





