+1-888-365-2779
Try Now
More in this section

Forums / General Discussions / Forums Post

Forums Post

7 posts, 0 answered
  1. Asif
    Asif avatar
    110 posts
    Registered:
    18 Nov 2010
    08 Dec 2010
    Link to this post
    Hi,
    I want to show the list of Forum Posts only the title of each forum posts. What method I should use for it?
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    08 Dec 2010
    Link to this post
    Hello Asif,

    There are 4 methods that you can use directly

    • public IPost GetPost(Guid postID)
    • public IList GetPosts(Guid parentID, bool descending, bool visibleOnly)
    • public IList GetPostsByAuthor(string authorName)
    • public IList GetForumPosts(Guid parentForumID)

    The last three methods return IList of IPost items. Each IPost item has  a property Title that you can use.

    Greetings,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. Asif
    Asif avatar
    110 posts
    Registered:
    18 Nov 2010
    08 Dec 2010
    Link to this post
    Hi,
    I am using below code but when I use GetForumPosts it gives me the error "No overload for method 'GetForumPosts' take 0 arguments"

     protected void Page_Load(object sender, EventArgs e)
        {
            Telerik.Forums.ForumManager forumManager = new Telerik.Forums.ForumManager();
        
            IList listOfAllPosts = forumManager.GetForumPosts();
            rptPosts.DataSource = listOfAllPosts;
            rptPosts.DataBind();
        }
  4. Asif
    Asif avatar
    110 posts
    Registered:
    18 Nov 2010
    08 Dec 2010
    Link to this post
    Hi,
    I am using a below code. It is working fine but I need to give a link under each post. How to give a link under each post? I mean what link should give in there? Right now I am giving "<a href='community-forum.aspx?ForumCatID=<%# Eval("id") %>'>" which is not making any sense
    Telerik.Forums.ForumManager forumManager = new Telerik.Forums.ForumManager();
         
            IList listForums = forumManager.GetForums(false);

            Telerik.Forums.Data.Forum frm = (Telerik.Forums.Data.Forum)listForums[0];

            IList listPosts = forumManager.GetForumPosts(frm.ID);
            rptCategories.DataSource = listPosts;
            rptCategories.DataBind();

    <asp:Repeater ID="rptCategories" runat="server">
        <HeaderTemplate><ul></HeaderTemplate>
        <ItemTemplate>
            <li><a href='community-forum.aspx?ForumCatID=<%# Eval("id") %>'><%# Eval("Title") %></a></li>
        </ItemTemplate>
        <FooterTemplate></ul></FooterTemplate>
    </asp:Repeater>
  5. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    08 Dec 2010
    Link to this post
    Hello Asif,

    Could you elaborate some more about what you are trying to achieve. From the description you provided I cannot understand what the desired result is.

    All the best,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  6. Asif
    Asif avatar
    110 posts
    Registered:
    18 Nov 2010
    08 Dec 2010
    Link to this post
    I am using the below code to display the list of Forum's posts. But I want if any user clicks on any post then the link redirect user to the post's description. I am not sure how to grab the post's url and put in my code.


    Telerik.Forums.ForumManager forumManager = new Telerik.Forums.ForumManager();
         
            IList listForums = forumManager.GetForums(false);

            Telerik.Forums.Data.Forum frm = (Telerik.Forums.Data.Forum)listForums[0];

            IList listPosts = forumManager.GetForumPosts(frm.ID);
            rptCategories.DataSource = listPosts;
            rptCategories.DataBind();

    <asp:Repeater ID="rptCategories" runat="server">
        <HeaderTemplate><ul></HeaderTemplate>
        <ItemTemplate>
            <li><a href='community-forum.aspx?ForumCatID=<%# Eval("id") %>'><%# Eval("Title") %></a></li>
        </ItemTemplate>
        <FooterTemplate></ul></FooterTemplate>
    </asp:Repeater>
  7. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    08 Dec 2010
    Link to this post
    Hello Asif,

    The post itself does not have a description. It has a property Content. Here is a list with all properties of IPost interface. In your case each post should have a title as a link and you should implement permalink similar to this one in our forums at sitefinity.com and telerik.com

    Regards,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Register for webinar
7 posts, 0 answered