<%@ 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>
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; } } } }
</div> </form> <form id="form1" runat="server"> <div> </div> </form>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)