Thursday 4 April 2019

Shopping Cart Program using ASP.NET | Web Technology

Shopping Cart Program using ASP.NET 
Step 1: Creating a New Web Application

Step 2: Add Web Form for the empty website application

Website -----àAdd New Item -> WebForm
The default web form name is Default.aspx




Step 3:  Adding the Database to the Program.
This also same procedure like how we added the web form
Website --à Add New Item -àSQL Server Database


For Creating Tables in the database first You have to select the Database Explorer
















You have Select Tables Folder then right-click and Select Add New table



Then Add Table Columns and its Data Types
Step 4: In this program there will be 3 Web Forms
1. Default.aspx
2. cart.aspx
3. bill.aspx

Default.aspx[Design Code]
Default.aspx.cs[Code File]
After double clicking dropdownlist write the code
Purchase Button Code
Code for Page_load and Creating Connection
cart.aspx[Design]
cart.aspx.cs[Code]
code for page_load() and namespace
Purchase button code

Bill Button Code

bill.aspx[Design]
bill.aspx.cs[Code]

Add Namespace at the top

using System.Data;
using System.Data.SqlClient;

Code inside page_load()

Output
After Selecting One product click Purchase Button then it will display cart.aspx page with following content


If you want to add one more product then click purchase button or you want get the bill click bill button. Here we are adding one more product so that it will go back to previous page with remembering the user you have to select only product from the dropdownlist and quantity.

If you are chosen for bill then it will display in the below format


Post a Comment

Whatsapp Button works on Mobile Device only

Start typing and press Enter to search