Hello,

I am trying to page an RSS page from asp maker. I keep getting the following error:

This page contains the following errors:
error on line 18 at column 102: Opening and ending tag mismatch: font line 0 and description
Below is a rendering of the page up to the first error.
test1 http://www.test.com/RSS.aspx test2 Vacaturenummer: Vacaturenummer Functie: Vacature Omschrijving
Here are my codes:

The RSS.aspx.cs file:

protected void GetChatmsg(int SVID, int RVID)
{
    try
    {
        using (SqlCommand cmd = new SqlCommand())
        {
            cmd.CommandText = "spr_Visitor_View_UserChatMsgs";
            cmd.Parameters.AddWithValue("@SVID", SVID.ToString());
            cmd.Parameters.AddWithValue("@RVID", RVID.ToString());
            //System.Data.DataTable dt = DBHelper.SqlExecuteReader(cmd);

            RSS.DataSource = DBHelper.SqlExecuteReader(cmd);
            RSS.DataBind();
        }
    }
    catch (Exception ex)
    {
        throw ex;
    }
}

private void Page_Load(System.Object sender, System.EventArgs e)
{
    _vacatureID = Request.QueryString("id");
    Connection();
    //Selectcommand Vacature Samenstellen
    _selectCommandVacature.CommandText = "SELECT Vacature_id,Vacature_functie,Vacature_datum,Vacature_tekst FROM Vacature WHERE Vacature_laatste_vacaturestatus=1 OR Vacature_laatste_vacaturestatus=4 ORDER BY Vacature_datum DESC";
    _selectCommandVacature.Connection = _con;
    try {
        _con.Open();
        _dataReader = _selectCommandVacature.ExecuteReader();
        while (_dataReader.Read) {
            LbLVacatureOmschrijving.Text = welkom1;
            LblVacaturenr.Text = welkom 2;
            //LblVacaturenr2.Text = _dataReader("vacature_id").ToString()
        }
    } finally {
        _con.Close();
    }

The rss.aspx file:

<%@ Page Language="C#" ContentType="text/xml" AutoEventWireup="true" CodeBehind="RSS.aspx.cs"  %>




           <rss version="2.0"> 
                <channel> 
                    <title>test1</title> 
                    <link>http://www.test.com/RSS.aspx</link> 
                    <description> 
                    test2
                    </description> 



            <item>  
                <title><font class="tableclass">Vacaturenummer:</font> <asp:label id="LblVacaturenr" runat="server">Vacaturenummer</asp:label></title>
                <description><font class="tableclass">Functie: <asp:label id="LbLVacatureOmschrijving" runat="server">Vacature Omschrijving</asp:label></description>
            </item> 

                </channel> 
           </rss>   

The rss.aspx seems to be right, since I almost copied it from another file.

But I have no idea what to do with the RSS.aspx.cs file, if anyone could help me I would really appreciate it.

Kind regards,

Dennis

First thing I see, the font tag doesn't have a closing tag on line 18. I would suspect it should be something like this:

<description><font class="tableclass">Functie:</font> <asp:label id="LbLVacatureOmschrijving" runat="server">Vacature Omschrijving</asp:label></description>

There are different approaches you can take. I built something like this a while back but did it in vb instead if c#. Take a look at the example and translate the concept in your own code.

http://www.itgeared.com/articles/1227-create-rss-feed-for-your-website/

The approach I took was building the output completely from the code behind page basically using XmlTextWriter.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.