Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6715119
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T08:34:35+00:00 2026-05-26T08:34:35+00:00

I’m trying to read my app comments, but I don’t know how? there is

  • 0

I’m trying to read my app comments, but I don’t know how? there is no correct/complete sample.

[CanvasAuthorize(Permissions = "user_about_me")]
    public ActionResult About()
    {
        var client = new FacebookWebClient(FacebookWebContext.Current.AccessToken);
        dynamic result = client.Get("19292868552_118464504835613/comments");
        ViewBag.result = result;
    }

and on view, try to read like this:

foreach (dynamic comment in ViewBag.result)
{
    @comment.id
    <text><br /></text>
}

please help how can I read the user comments entered for a Facebook page in a MVC application.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T08:34:36+00:00Added an answer on May 26, 2026 at 8:34 am

    as you know in Facebook you can create your own page and that page has an ID in URL.
    Here is the codes for the controller:

    [CanvasAuthorize(Permissions = "user_about_me")]
        public ActionResult Comments()
        {
            var client = new FacebookWebClient(FacebookWebContext.Current.AccessToken);
            dynamic feeds = client.Get("{PageID}/feed");
    
    
            ViewBag.feeds = feeds;
            return View();
        }
    

    and the codes for your view:

    <table>
    @foreach (dynamic myFeed in ViewBag.feeds.data)
    {
    
        if (myFeed.type == "status" && myFeed.from.id != "{PageID}")
        { 
    
        <tr>
            <td>
                <img src="@HomeController.GetPictureUrlSmall(myFeed.from.id)" />
            </td>
            <td>
                <span style="font-weight: bold;">@myFeed.from.name</span><br />
                @myFeed.message
            </td>
        </tr>
    
        }
    }
    </table> 
    @{
    string strNext = ViewBag.feeds.paging.next;
    string strPrevious = ViewBag.feeds.paging.previous;
    }
    <a href="@strPrevious" >Previous</a>
    <br />
    <a href="@strNext" >Next</a>
    

    A function for getting the users pictures:

    public static string GetPictureUrlSmall(string faceBookId)
        {
            WebResponse response = null;
            string pictureUrl = string.Empty;
            try
            {
                WebRequest request = WebRequest.Create(string.Format("http://graph.facebook.com/{0}/picture?type=small", faceBookId));
                response = request.GetResponse();
                pictureUrl = response.ResponseUri.ToString();
            }
            catch (Exception ex)
            {
                //? handle
            }
            finally
            {
                if (response != null) response.Close();
            }
            return pictureUrl;
        }
    

    I hope it will be helpful for some developers but I still have problem with pagination. I didn’t find a handy solution for that. Thanks, Pedram

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am trying to render a haml file in a javascript response like so:
Seemingly simple, but I cannot find anything relevant on the web. What is the
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.