我如何在asp.net Web应用程序中计算来自Facebook的朋友? [英] How can I count my friends from Facebook in my asp.net web application?

查看:59
本文介绍了我如何在asp.net Web应用程序中计算来自Facebook的朋友?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好朋友,
我正在开发一个ASP.NET应用程序.我在应用程序中实现了Facebook JavaScript API,用于与Facebook连接并获取用户的FB朋友列表.我已经成功地做到了.
现在,我想计算一下用户邀请了多少个朋友. Facebook API是否可以使用.用户可以选择多个朋友,我想统计用户选择并邀请了多少个朋友,如果可以的话,邀请的朋友ID是加分项.
请不要忘记出于安全原因,facebook更改了其Oauth设置.
单击发送邀请"按钮并将页面发回到
后,我也在尝试获取ID值

Hello friends,
I am developing an ASP.NET application. I implemented Facebook JavaScript API in my application, for connect with Facebook and get FB friend list of user. I had done this successfully.
Now, I want to count how many friends are invited by user. Is it possible with facebook API. User can select multiple friends and i want to count how many friends selected and invited by user, Invited friends Id is bonus if We can get.
Please don''t forget that facebook changed its Oauth settings for security reasons.
I''m also trying to get ids values after Send Invitation button clicked and page post back to

        if (Request.Form["ids"] != null)
            {
                span1.InnerHtml = "ids";
//put success code here..
            }
            else
            {
                span1.InnerHtml = "oops no id";
            }
          if (Page.PreviousPage != null)
            {
                span1.InnerHtml = "ids";
//put success code here..
            }
            else
            {
                span1.InnerHtml = "oops no id";
            }


但是在这种情况下,程序控制始终转到其他条件,这意味着页面回发后返回空值.
有什么方法可以获取受邀朋友的ID.
谢谢.


but in this case program control always goes to else condition it means after page is post back form return null value.
Is there any way to get ids of invited friends.
Thanks.

推荐答案

好吧,我终于解决了这个问题,并得到了受邀的朋友ids .. :)

只需在您的.js文件中进行更改,即可将您的facebook连接javascript代码放入其中.在fb:request-form标记中使用Get或Request方法代替Post Method.

Ok finally I resolve this issue and get invited friends ids.. :)

Just make on change in your .js file where you put your facebook connect javascript code. Use Get or Request Method instead of Post Method in fb:request-form tag.

var fbhtml = "<fb:serverfbml width="\""" width_of_invitation_div="" xmlns:fb="#unknown"><script type=\"text/fbml\"><fb:fbml><fb:request-form action=" + window.location + " method="REQUEST" invite="true" type="" + type_of_fb_request_form + "" hold=" /><br mode="></fb:request-form></fb:fbml></script></fb:serverfbml>"



邀请发送给选定朋友后,您会在网址中获得ID [].
您可以通过查询字符串获取这些ID,并通过逗号(,)拆分ID并将其存储在数组中.
享受FBConnect.



After invitation send to users selected friends you get ids[] in url.
you can get these ids through query string and split ids by comma(,) and store in array.
Enjoy FBConnect.


这篇关于我如何在asp.net Web应用程序中计算来自Facebook的朋友?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆