using System; using System.Collections; using System.ComponentModel; using System.Data; using System.Drawing; using System.Web; using System.Web.SessionState; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.HtmlControls; namespace RSSClient { public partial class RSSSelectForm : System.Web.UI.Page { private com.harbormist.RSSService webService = new com.harbormist.RSSService(); protected void Page_Load(object sender, System.EventArgs e) { // call web service, get all site names, and display them // in the list box foreach (string name in webService.GetAllSiteNames()) listBox.Items.Add(new ListItem(name, name)); if (listBox.Items.Count > 0) listBox.Items[0].Selected = true; this.SetFocus(listBox); } #region VS.NET generated code override protected void OnInit(EventArgs e) { InitializeComponent(); base.OnInit(e); } private void InitializeComponent() { } #endregion protected void ButtonSelect_Click(object sender, System.EventArgs e) { //get current selection, look up URL for the given site name, //put URL in session, and redirect to XMLDisplay.aspx string selection = listBox.SelectedValue; if (selection != null && selection != "") { string sourceURL = webService.GetURL(selection); if (sourceURL != null) { Session["sourceURL"] = sourceURL; Response.Redirect("XMLDisplay.aspx"); } } } } }