forked from JAMK-ICT-IIO13200/viikkotehtava-1
-
Notifications
You must be signed in to change notification settings - Fork 0
/
g2456_FinnKinoMovies.aspx.cs
43 lines (37 loc) · 1.25 KB
/
g2456_FinnKinoMovies.aspx.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
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Xml;
public partial class g2456_FinnKinoMovies : System.Web.UI.Page
{
string urlTotTheatres;
string urlToMovies;
protected void Page_Load(object sender, EventArgs e)
{
urlTotTheatres = ConfigurationManager.AppSettings["finnkinoteatterit"];
urlToMovies = ConfigurationManager.AppSettings["finnkinoelokuvat"];
}
protected void btnGetTheatres_Click(object sender, EventArgs e)
{
//Haetaan leffat listboxiin
XmlDocument doc = new XmlDocument();
doc.Load(urlTotTheatres);
XmlNodeList nodes = doc.DocumentElement.SelectNodes("TheatreArea");
foreach (XmlNode node in nodes)
{
ListItem li = new ListItem(node["Name"].InnerText, node["ID"].InnerText);
myListBox.Items.Add(li);
}
}
protected void myListBox_SelectedIndexChanged(object sender, EventArgs e)
{
string theatreShows = urlToMovies + myListBox.SelectedItem.Value;
myDataSource.DataFile = theatreShows;
myRepeater.DataSource = myDataSource;
myRepeater.DataBind();
}
}