-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathenquiry form.cs
71 lines (67 loc) · 2.09 KB
/
enquiry form.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
Design ticket enquiry form for a theatre. Select location (Mumbai/Pune) using radio button. When user clicks a location, it fills a combo box with names of theatre’s in that city. When user selects the name of the theatre, the list of films currently shown and their show timings should be displayed in table.
Code:
Default.aspx
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class _Default : System.Web.UI.Page
{
TableRow tr;
TableCell tc1, tc2;
protected void Page_Load(object sender, EventArgs e)
{
}
protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
{
if (DropDownList1.SelectedValue == "Mumbai")
{
DropDownList2.Items.Clear();
DropDownList2.Items.Add("PVR");
DropDownList2.Items.Add("INOX");
}
if (DropDownList1.SelectedValue == "Pune")
{
DropDownList2.Items.Clear();
DropDownList2.Items.Add("IMAX");
DropDownList2.Items.Add("GALAXY");
}
}
protected void DropDownList2_SelectedIndexChanged(object sender, EventArgs e)
{
Table1.Rows.Clear();
if (DropDownList2.SelectedValue == "PVR")
{
addmov("Padmavat", "12-2");
addmov("Zila Ghaziabad", "3-5");
}
else if (DropDownList2.SelectedValue == "INOX")
{
addmov("Ungli", "12-2");
addmov("Begam Jaan", "3-5");
}
else if (DropDownList2.SelectedValue == "IMAX")
{
addmov("Raees", "12-2");
addmov("The Killer", "3-5");
}
else
{
addmov("The Ghazi Attack", "12-2");
addmov("Haseena Parker", "3-5");
}
}
void addmov(String name, String time)
{
tr = new TableRow();
tc1 = new TableCell();
tc2 = new TableCell();
tc1.Text = name;
tc2.Text = time;
tr.Cells.Add(tc1);
tr.Cells.Add(tc2);
Table1.Rows.Add(tr);
}
}