Click here to Skip to main content
15,911,035 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello All,
How can i Invite Facebook friends using Asp.net.

I tried a lot but not able to get exact code how can i invite facebook friends using asp.net .

Please suggest.

Thanks in advance
Posted
Comments
[no name] 9-Sep-11 3:38am    
did u ask google for this?

I did that using JS

C#
//initializing API
window.fbAsyncInit = function () { FB.init({ appId: apiKeyofYourApp, status: true, cookie: true, xfbml: true }); };
(function () {
    var e = document.createElement('script'); e.async = false;
    e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js';
    var dv = document.createElement('div');
    dv.id = "fb-root";
    document.body.appendChild(dv);
    document.getElementById('fb-root').appendChild(e);

    //Insert div to loader while fetching information from facebook
    var fbLoader = document.createElement('div');
    fbLoader.id = "fbLoader";
    document.body.appendChild(fbLoader);
    var fbFade = document.createElement('div');
    fbFade.id = "fbfade";
    document.body.appendChild(fbFade);

} ());


C#
//function to start Facebook invitation process
function fbinvitelogin() {
    FB.login(function (response) {
        inviteFriends('dvFBContacts');
        //...
    }, { perms: accessParameters });
}


C#
//Internal function- do not call it.
function inviteFriends(contDiv) {
    FB.getLoginStatus(function (response) {
        if (response.session) {
            //To get already member with your site
            $('#dvFBNonLoggedIn').fadeOut('slow');
            $('#dvFBLoggedIn').fadeIn('slow');
            $('#dvWait').fadeOut('slow');
            getAlreadyUsingFBIds(contDiv);

        } else {
            $('#dvFBNonLoggedIn').fadeIn('slow');
            $('#dvFBLoggedIn').fadeOut('slow');
            $('#dvWait').fadeOut('slow');
        }
    });
}
 
Share this answer
 
Mr.Raj,
Can not understand your question....
??????
 
Share this answer
 
Comments
Uday P.Singh 9-Sep-11 3:41am    
Use comments if question is not clear to you.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900