Home > OS >  Default.aspx form missing
Default.aspx form missing

Time:01-11

I am trying to follow this Tutorial
Windows Features

Edit getting this ERROR

Line 7:  Public Module BundleConfig

Line 8: ' For more information on Bundling, visit enter image description here

  • Click Next

  • Select the following:

    enter image description here

  • Click Next

  • Enter desired project name (ex: RSSFeedReader)

  • Click Create

  • Select the following:

    enter image description here

  • Optional: On right-side, under Advanced, uncheck Configure for HTTPS

  • Click Create

  • Open Solution Explorer

    • In VS menu, click View
    • Select Solution Explorer

    Add class (name: RSSFeed.vb)

    • In Solution Explorer, right-click <project name> (ex: RSSFeedReader)
    • Select Add
    • Select Class... (name: RSSFeed.vb)
    • Click Add

    RSSFeed.vb

    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
    

    Add WebForm (name: default.aspx)

    • In Solution Explorer, right-click <project name> (ex: RSSFeedReader)
    • Select Add
    • Select New Item...
    • Select Web Form (name: default.aspx)
    • Click Add

    Modify default.aspx

    • In Solution Explorer, right-click default.aspx
    • Select View Markup

    default.aspx:

    <%@ Page Language="vb" AutoEventWireup="false" CodeBehind="default.aspx.vb" Inherits="RSSFeedReader._default" %>
    
    <!DOCTYPE html>
    
    <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" >
    
                <!-- Where XYZ refers to the publication from where you wish to fetch the RSS feed from -->
                <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>
    

    Modify default.aspx.vb

    • In Solution Explorer, right-click default.aspx
    • Select View Code

    default.aspx.vb:

    Public Class _default
        Inherits System.Web.UI.Page
    
        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
            PopulateRssFeed("https://www.nasa.gov/rss/dyn/lg_image_of_the_day.rss")
        End Sub
    
        Private Sub PopulateRssFeed(rssFeedUrl As String)
            'create new List
            Dim feeds As List(Of RSSFeed) = New List(Of RSSFeed)
    
            Try
                'create new instance
                Dim xDoc As XDocument = New XDocument()
    
                'load
                xDoc = XDocument.Load(rssFeedUrl)
    
                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
    
                gvRss.DataSource = feeds
                gvRss.DataBind()
            Catch ex As Exception
                Throw ex
            End Try
        End Sub
    End Class
    

    Resources:

    •  Tags:  
    • Related