Richard Here is what I have learned from your Solution
BUT this code continues to give me the ERROR
Could Not Load Type RSSFeedReader_default
Any Help Fixing the Error would be greatly appreciated
Here is the code with some commented out things I have tried to fix the Error
'Option Strict On
Option Explicit On
'Public Class _default
Partial Public Class _default
Inherits System.Web.UI.Page
'Protected WithEvents Form1 As Global.System.Web.UI.HtmlControls.HtmlForm
'Protected WithEvents gvRss As Global.System.Web.UI.WebControls.GridView
'Protected WithEvents lblLogMsg As Global.System.Web.UI.WebControls.Label
Private gvRss As Object
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
'ToDo: replace with the URL to your desired RSS feed
Dim rssFeedUrls As List(Of String) = New List(Of String)()
'add desired URLs
rssFeedUrls.Add("https://www.nasa.gov/rss/dyn/lg_image_of_the_day.rss")
rssFeedUrls.Add("http://thehill.com/rss/syndicator/19110")
'get data
PopulateRssFeed(rssFeedUrls)
End Sub
Private Sub PopulateRssFeed(rssFeedUrls As List(Of String))
'create new List
Dim feeds As List(Of RSSFeed) = New List(Of RSSFeed)
Dim currentURL As String = String.Empty
Try
For Each url As String In rssFeedUrls
'set value
currentURL = url
'create new instance
Dim xDoc As XDocument = New XDocument()
'load
xDoc = XDocument.Load(url)
Dim items = From x In xDoc.Descendants("item")
Select New RSSFeed With
{
.Title = x.Element("title").Value,
.Link = x.Element("link").Value,
.PublishDate = x.Element("pubDate").Value,
.Description = x.Element("description").Value
}
If items IsNot Nothing Then
For Each i In items
Dim f As RSSFeed = New RSSFeed() With {
.Title = i.Title,
.Link = i.Link,
.PublishDate = i.PublishDate,
.Description = i.Description
}
'add
feeds.Add(f)
Next
End If
Next
gvRss.DataSource = feeds
gvRss.DataBind()
Catch ex As Exception
'ToDo: replace with desired code
Dim errMsg As String = String.Format("Error (PopulateRssFeed): {0} (url: {1})", ex.Message, currentURL)
'Debug.WriteLine(errMsg)
'WriteLine(errMsg)
MsgBox("ER " & errMsg)
Throw ex
End Try
End Sub
End Class
Imports Microsoft.VisualBasic
Public Class RSSFeed
Public Property Title As String
Public Property Link As String
Public Property PublishDate As String
Public Property Description As String
End Class
This is the code causing the Error the very first line
<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Default.aspx.vb" Inherits="RSSFeedReader._Default" %>
<!DOCTYPE html5>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<h3>Read RSS Feed from "NASA"</h3>
<form id="Form1" runat="server" >
<div style="max-height:350px; overflow:auto">
<asp:GridView ID="gvRss" runat="server" AutoGenerateColumns="false" ShowHeader="false" Width="90%">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<table width="100%" border="0" cellpadding="0" cellspacing="5">
<tr>
<td>
<h3 style="color:#3E7CFF"><%#Eval("Title") %></h3>
</td>
<td width="200px">
<%#Eval("PublishDate") %>
</td>
</tr>
<tr>
<td colspan="2">
<hr />
<%#Eval("Description") %>
</td>
</tr>
<tr>
<td> </td>
<td align="right">
<a href='<%#Eval("Link") %>' target="_blank">Read More...</a>
</td>
</tr>
</table>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</div>
</form>
</body>
</html>