error in SocialNetwork.WebSite

Jul 17, 2008 at 3:12 PM
Edited Jul 17, 2008 at 3:12 PM

I am using VS Web Developer 2008 to rebuild the SocialNetwork.WebSite, but have some problems. I'v added all needed dll files, i.e. rsstoolkit, ajaxtoolkit, livenet, antixsslibrary, and all dll files generated by the other SocialNetwork sub-projects.
When I ran build, I got an error: 
Error 1 Unknown server tag 'cc1:RssDataSource'. C:\Documents and Settings\Administrator\Desktop\QuickApps 7.0\WLQuickApps.SocialNetwork\WLQuickApps.SocialNetwork.WebSite\Controls\BlogHeadlines.ascx 17 

After I specified the full path of the namespace in BlogHeadlines.ascx, i.e. <%@ Register Assembly="RssToolkit" Namespace="RssToolkit.Web.WebControls" TagPrefix="cc1" %>, then the error became: 
Error 1 The type or namespace name 'GenericRssElement' could not be found (are you missing a using directive or an assembly reference?) C:\Documents and Settings\Administrator\Desktop\QuickApps 7.0\WLQuickApps.SocialNetwork\WLQuickApps.SocialNetwork.WebSite\Controls\BlogHeadlines.ascx.cs 52 9 C:\...\WLQuickApps.SocialNetwork.WebSite\

Error 2 'RssToolkit.Web.WebControls.RssDataSource' does not contain a definition for 'Channel' C:\Documents and Settings\Administrator\Desktop\QuickApps 7.0\WLQuickApps.SocialNetwork\WLQuickApps.SocialNetwork.WebSite\Controls\BlogHeadlines.ascx.cs 36 66 C:\...\WLQuickApps.SocialNetwork.WebSite\

I think there is a namespace problem here, but dont know how to fix. Any advice and help is appreciated.

P.

 

 

 

 

Oct 15, 2009 at 11:35 PM

apply the following changes:

--- C:/Temp/BlogHeadlines.ascx-revBASE.svn000.tmp.ascx 
+++ C:/SocialNetwork/SocialNetwork.WebSite/Controls/BlogHeadlines.ascx 
@@ -1,14 +1,14 @@
 <%@ Control Language="C#" AutoEventWireup="true" CodeFile="BlogHeadlines.ascx.cs" Inherits="BlogHeadlines" %>
-<%@ Register Assembly="RssToolkit" Namespace="RssToolkit" TagPrefix="cc1" %>
+<%@ Register Assembly="RssToolkit" Namespace="RssToolkit.Web.WebControls" TagPrefix="cc1" %>
 
 <asp:Panel runat="server" ID="_blogHeadlinesPanel" SkinID="BlogRotator">
     <asp:DataList runat="server" ID="_blogHeadlines">
         <ItemTemplate>
             <asp:Label runat="server" ID="_blogItemDate" SkinID="BlogItemDate">
-                <%# DateTime.Parse(((GenericRssElement)Container.DataItem)["PubDate"]).ToString("MMM d, yyyy") %>
+                <%# DateTime.Parse(((RssToolkit.Rss.RssItem)Container.DataItem).PubDate).ToString("MMM d, yyyy")%>
             </asp:Label>
             <asp:Image runat="server" ID="_arrow" ImageUrl="~/Images/Arrow.gif" />           
-            <asp:HyperLink runat="server" ID="_blogItemLink" NavigateUrl='<%# ((GenericRssElement)Container.DataItem)["Link"] %>'
+            <asp:HyperLink runat="server" ID="_blogItemLink" NavigateUrl='<%# ((RssToolkit.Rss.RssItem)Container.DataItem).Link %>'
                 Target="_blank" Text='<%# this.GetRssItemTitle(Container.DataItem) %>' SkinID="BlogItemTitle" />
         </ItemTemplate>
     </asp:DataList>

and

--- C:/Temp/BlogHeadlines.ascx.cs-revBASE.svn000.tmp.cs 
+++ C:/SocialNetwork/SocialNetwork.WebSite/Controls/BlogHeadlines.ascx.cs
@@ -9,62 +9,50 @@
 using System.Web.UI.WebControls.WebParts;
 using System.Web.UI.HtmlControls;
 using RssToolkit;
+using RssToolkit.Rss;
 
-public partial class BlogHeadlines : System.Web.UI.UserControl
-{
-    public string RssUrl
-    {
-        get { return this._rssDataSource.Url; }
-        set { this._rssDataSource.Url = value; }
-    }
+public partial class BlogHeadlines : System.Web.UI.UserControl {
+ public string RssUrl {
+  get { return this._rssDataSource.Url; }
+  set { this._rssDataSource.Url = value; }
+ }
 
-    public string ErrorText
-    {
-        get { return this._errorLabel.Text; }
-        set { this._errorLabel.Text = value; }
-    }
+ public string ErrorText {
+  get { return this._errorLabel.Text; }
+  set { this._errorLabel.Text = value; }
+ }
 
-    protected void Page_Load(object sender, EventArgs e)
-    {
-    }
+ protected void Page_Load(object sender, EventArgs e) {
+ }
 
-    protected override void DataBindChildren()
-    {
-        try
-        {
-            this._rssDataSource.DataBind();
-            this._blogHeadlines.DataSource = this._rssDataSource.Channel.Items;
+ protected override void DataBindChildren() {
+  try {
+   this._rssDataSource.DataBind();
+   this._blogHeadlines.DataSource = this._rssDataSource.Rss.Channel.Items;
 
-            base.DataBindChildren();
+   base.DataBindChildren();
 
-            this._blogHeadlinesPanel.Visible = true;
-            this._errorLabel.Visible = false;
-        }
-        catch
-        {
-            this._blogHeadlinesPanel.Visible = false;
-            this._errorLabel.Visible = true;
-        }
-    }
+   this._blogHeadlinesPanel.Visible = true;
+   this._errorLabel.Visible = false;
+  } catch {
+   this._blogHeadlinesPanel.Visible = false;
+   this._errorLabel.Visible = true;
+  }
+ }
 
-    protected string GetRssItemTitle(object rssItem)
-    {
-        GenericRssElement element = (GenericRssElement)rssItem;
+ protected string GetRssItemTitle(object rssItem) {
+  RssItem element = (RssItem)rssItem;
 
-        if (!element.Attributes.ContainsKey("Title"))
-        {
-            return "Untitled";
-        }
-        else
-        {
-            string title = element.Attributes["Title"];
+  if (string.IsNullOrEmpty(element.Title)) {
+   return "Untitled";
+  } else {
+   string title = element.Title;
 
-            if (title.Length > 70)
-            {
-                title = title.Substring(0, 65) + "...";
-            }
+   if (title.Length > 70) {
+    title = title.Substring(0, 65) + "...";
+   }
 
-            return this.Server.HtmlEncode(title);
-        }
-    }
+   return this.Server.HtmlEncode(title);
+  }
+ }
 }