.net 3,4

 Online mobile shop


Site1.Master 

<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="Site1.master.cs" 

Inherits="OnlineMobilePhoneShop.Site1" %> 

 

<!DOCTYPE html> 

 

<html> 

<head> 

    <title>Online Mobile Phone Shop</title> 

    <link rel="stylesheet" type="text/css" href="Styles.css" /> 

</head> 

<body> 

    <form id="Form1" runat="server"> 

        <div class="header"> 

            <h1>Online Mobile Phone Shop</h1> 

            <nav> 

                <a href="Default.aspx">Home</a> | 

                <a href="Product.aspx">Products</a> | 

                <a href="Cart.aspx">Cart</a> 

            </nav> 

        </div> 

        <asp:ContentPlaceHolder ID="MainContent" 

runat="server"></asp:ContentPlaceHolder> 

        <div class="footer">&copy; 2025 Online Mobile Shop</div> 

    </form> 

</body> 

</html> 

Default.aspx 

<%@ Page Title="" Language="C#" MasterPageFile="~/Site1.Master" AutoEventWireup="true" 

CodeBehind="Default.aspx.cs" Inherits="OnlineMobilePhoneShop.WebForm1" %> 

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server"> 

    <h2>Welcome to the Online Mobile Shop</h2> 

    <p>Find the best mobile phones at the best prices.</p> 

</asp:Content> 

Cart.aspx 

<%@ Page Title="" Language="C#" MasterPageFile="~/Site1.Master" AutoEventWireup="true" 

CodeBehind="Cart.aspx.cs" Inherits="OnlineMobilePhoneShop.WebForm3" %> 

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server"> 

    <h2>Your Shopping Cart</h2> 

    <asp:Label ID="lblCart" runat="server" Text="Your Cart is Empty..."></asp:Label> 

</asp:Content> 

 

Product.aspx 

<%@ Page Title="" Language="C#" MasterPageFile="~/Site1.Master" AutoEventWireup="true" 

CodeBehind="Cart.aspx.cs" Inherits="OnlineMobilePhoneShop.WebForm3" %> 

<asp:Content ID="Content3" ContentPlaceHolderID="MainContent" runat="server"> 

    <h2>Your Shopping Cart</h2> 

    <asp:Label ID="Label1" runat="server" Text="Your Cart is Empty..."></asp:Label> 

</asp:Content> 

 

Cart.aspx.cs 

using System; 

using System.Web.UI; 

namespace OnlineMobilePhoneShop 

    public partial class WebForm3 : Page 

    { 

        protected void Page_Load(object sender, EventArgs e) 

        { 

            if (Session["Cart"] != null) 

            { 

                lblCart.Text= "Your Cart: " + Session["Cart"].ToString(); 

            } 

            else 

            { 

                lblCart.Text = "Your cart is empty."; 

            } 

        } 

    } 

 

Product.aspx.cs 

using System; 

using System.Web.UI; 

 

namespace OnlineMobilePhoneShop 

 

    public partial class WebForm2 : Page 

    { 

        protected void btnAddToCart_Click(object sender, EventArgs e) 

        { 

            if (lstProducts.SelectedItem != null) 

            { 

                Session["Cart"] = lstProducts.SelectedItem.Text; 

                Response.Redirect("Cart.aspx"); 

            } 

        } 

    } 

Styles.css 

body { 

    font-family: Arial, sans-serif; 

    margin: 0; 

    padding: 0; 

    text-align: center; 

.header { 

    background: #004080; 

    color: white; 

    padding: 15px; 

.footer { 

    background: #222; 

    color: white; 

    padding: 10px; 

    position: absolute; 

    bottom: 0; 

    width: 100%; 

nav a { 

    color: white; 

    text-decoration: none; 

    margin: 0 10px; 


Online registration

Site1.Master 
<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="Site1.master.cs" 
Inherits="OnlineRegistration.Site1" %> 
 
<!DOCTYPE html> 
 
<html> 
<head> 
    <title>Online Registration Form</title> 
    <link rel="stylesheet" type="text/css" href="Styles.css" /> 
</head> 
<body> 
    <form id="Form1" runat="server"> 
        <div class="header"> 
            <h1>Online Registration Form</h1> 
            <nav> 
                <a href="Default.aspx">Home</a> | 
                <a href="Register.aspx">Register</a> 
            </nav> 
        </div> 
        <asp:ContentPlaceHolder ID="MainContent" 
runat="server"></asp:ContentPlaceHolder> 
        <div class="footer">&copy; 2025 Online Registration</div> 
    </form> 
</body> 
</html> 
 
Default.aspx 
<%@ Page Title="" Language="C#" MasterPageFile="~/Site1.Master" AutoEventWireup="true" 
CodeBehind="Default.aspx.cs" Inherits="OnlineRegistration.WebForm1" %> 
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server"> 
     <h2>Welcome to the Online Registration System</h2> 
    <p>Register today to access exclusive features.</p> 
</asp:Content> 
 
Register.aspx 
<%@ Page Title="" Language="C#" MasterPageFile="~/Site1.Master" AutoEventWireup="true" 
CodeBehind="Register.aspx.cs" Inherits="OnlineRegistration.WebForm2" %> 
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server"> 
    <h2>Registration Form</h2> 
    <table> 
        <tr> 
            <td>Name:</td> 
            <td><asp:TextBox ID="txtName" runat="server" /></td> 
        </tr> 
        <tr> 
            <td>Email:</td> 
            <td><asp:TextBox ID="txtEmail" runat="server" /></td> 
        </tr> 
        <tr> 
            <td>Password:</td> 
            <td><asp:TextBox ID="txtPassword" runat="server" TextMode="Password" 
/></td> 
        </tr> 
        <tr> 
            <td></td> 
            <td><asp:Button ID="btnRegister" runat="server" Text="Register" 
OnClick="btnRegister_Click" /></td> 
        </tr> 
    </table> 
    <asp:Label ID="lblMessage" runat="server" ForeColor="Green" /> 
</asp:Content> 
 
Register.aspx.cs 
using System; 
using System.Collections.Generic; 
using System.Linq; 
using System.Web; 
using System.Web.UI; 
using System.Web.UI.WebControls; 
 
namespace OnlineRegistration 
    public partial class WebForm2 : System.Web.UI.Page 
    { 
        protected void btnRegister_Click(object sender, EventArgs e) 
        { 
            string name = txtName.Text; 
            string email = txtEmail.Text; 
            string password = txtPassword.Text; 
            lblMessage.Text = "Registration successful for " + name; 
        } 
    } 
Styles.CSS 
body { 
    font-family: Arial, sans-serif; 
    margin: 0; 
    padding: 0; 
    text-align: center; 
.header { 
    background: #004080; 
    color: white; 
    padding: 15px; 
.footer { 
    background: #222; 
    color: white; 
    padding: 10px; 
    position: absolute; 
    bottom: 0; 
    width: 100%; 
nav a { 
    color: white; 
    text-decoration: none; 
    margin: 0 10px; 



Comments

Popular posts from this blog

RDBMS

.Net

1-5