-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathrssfeed.aspx.cs
More file actions
70 lines (60 loc) · 1.69 KB
/
rssfeed.aspx.cs
File metadata and controls
70 lines (60 loc) · 1.69 KB
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
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;
using CleverComponents.InetSuite;
namespace inetsuitedemocs
{
/// <summary>
/// Summary description for rss.
/// </summary>
public partial class rss : System.Web.UI.Page
{
protected CleverComponents.InetSuite.Rss rss1;
protected void Page_Load(object sender, System.EventArgs e)
{
// Put user code to initialize the page here
}
#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeComponent();
base.OnInit(e);
}
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.rss1 = new CleverComponents.InetSuite.Rss();
}
#endregion
protected void Button1_Click(object sender, System.EventArgs e) {
rss1.Get(edtURL.Text);
edtTitle.Text = Server.HtmlEncode(rss1.Channel.Title);
edtLink.Text = Server.HtmlEncode(rss1.Channel.Link);
edtDescription.Text = Server.HtmlEncode(rss1.Channel.Description);
DataTable messages = new DataTable();
messages.Columns.Add("Title");
messages.Columns.Add("Date");
foreach (RssItem item in rss1.Items) {
DataRow row = messages.NewRow();
row["Title"] = item.Title;
row["Date"] = item.PubDate.ToString();
messages.Rows.Add(row);
}
DataGrid1.DataSource = messages;
DataGrid1.DataBind();
}
}
}