Click here to Skip to main content
15,884,176 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
my source code is .....below

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="example.aspx.cs" Inherits="OnlineMoviesticketBooking.example" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <style type="text/css">

        .auto-style1 {
            width: 100%;
        }
        .auto-style3 {
            font-size: x-large;
            height: 75px;
        }
        .auto-style6 {
            font-size: x-large;
            text-align: center;
            background-color: #173102;
        }
        .auto-style7 {
            width: 1292px;
            height: 123px;
        }
        .auto-style8 {
            font-size: x-large;
            background-color: #173102;
        }
        .auto-style10 {
            font-size: x-large;
        }
        .auto-style11 {
            font-size: xx-large;
            text-align: center;
            background-color: #173102;
            color: #FFFFFF;
        }
        </style>
</head>
<body>
    <form runat="server">
    <div>
    
        <table class="auto-style1">
            <tr>
                <td class="auto-style3" colspan="6">
                    <img alt="" class="auto-style7" src="http://localhost:13572/Images/banner%20(1).jpg" /></td>
            </tr>
            <tr>
                <td class="auto-style11" colspan="6">
                    ONLINE MOVIES TICKET BOOKING</td>
            </tr>
            <tr>
                <td class="auto-style6">
                    <asp:DropDownList ID="lstCity" runat="server" CssClass="auto-style10" AutoPostBack="True" OnSelectedIndexChanged="lstCity_SelectedIndexChanged">
                    </asp:DropDownList>
                </td>
                <td class="auto-style6">
                    <asp:DropDownList ID="lstCinema" runat="server" CssClass="auto-style10">
                    </asp:DropDownList>
                </td>
                <td class="auto-style6">
                    <asp:DropDownList ID="lstMovie" runat="server" CssClass="auto-style10">
                    </asp:DropDownList>
                </td>
                <td class="auto-style6">
                    <asp:DropDownList ID="lstTiming" runat="server" CssClass="auto-style10">
                    </asp:DropDownList>
                </td>
                
                <td class="auto-style6">
                    <asp:DropDownList ID="lstClass" runat="server" CssClass="auto-style10">
                    </asp:DropDownList>
                </td>
            </tr>
            <tr>
                <td class="auto-style8" colspan="6"> </td>
            </tr>
            <tr>
                <td class="auto-style8" colspan="3">
                     </td>
                <td class="auto-style8" colspan="3">
                     </td>
            </tr>
            <tr>
                <td class="auto-style6" colspan="6"> </td>
            </tr>
            <tr>
                <td class="auto-style6" colspan="6">
                     </td>
            </tr>
            <tr>
                <td class="auto-style6" colspan="6">
                     </td>
            </tr>
            </table>
    
    </div>
    </form>
    <form id="form1" runat="server">
    <div>
    
    </div>
    </form>
</body>
</html>


What I have tried:

code file

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace OnlineMoviesticketBooking
{
    public partial class example : System.Web.UI.Page
    {
        List<string> city = new List<string>()
        {
            "Select a City",
            "Hyderabad",
            "Delhi"
        };
        List<string> Hyderabadcinema = new List<string>()
        {
            "Select a Cinema",
            "HI-Tech Cinema",
            "Satyam Theater"
        };

        List<string> Delhicinema = new List<string>()
        {
            "Select a Cinema",
            "PVR NCR",
            "Milan Cinema"
        };
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                foreach (var item in city)
                {
                    lstCity.Items.Add(item);
                }
            }
        }

        protected void lstCity_SelectedIndexChanged(object sender, EventArgs e)
        {
            switch (lstCity.SelectedIndex)
            {
                case 1:
                    lstCinema.Items.Clear();
                    foreach (var item in Hyderabadcinema)
                    {
                        lstCinema.Items.Clear();
                        lstCinema.Items.Add(item);
                    }
                    break;
                case 2:
                    lstCinema.Items.Clear();
                    foreach (var item in Delhicinema)
                    {
                        lstCinema.Items.Clear();
                        lstCinema.Items.Add(item);
                    }
                    break;

            }
        }
    }
}
Posted
Updated 26-Oct-17 9:07am
v2
Comments
Pankaj hyderabad 26-Oct-17 14:52pm    
is auyone helpme??

1 solution

Remove one of the form tags. The error is fairly straight forward.

</div>
</form>
<form id="form1" runat="server">
<div>

</div>
</form>
 
Share this answer
 
v2
Comments
Pankaj hyderabad 26-Oct-17 15:24pm    
Thank you sir

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900