vini
vini

Reputation: 4722

How to send private message to user using asp.net?

enter image description here

I am trying to achieve something like this in asp.net when the user clicks on the invite button corresponding to the user a send dialog is populated with his/her name and a message can be sent

How do i do this in asp.net ?

please help

EDIT: Well i have been successful in getting this popup however i want to populate the name of my friend whom i intend to invite in the To field This message will be sent as a facebook message

ASPX.CS

 to = fr.data[i].name;
Page.ClientScript.RegisterStartupScript(Type.GetType("System.String"), "addScript", "PassValues('" + to + "')", true);

How do i pass this to to my client side facebook function which is as follows:

 function facebook_send_message(to) {
FB.ui({
    app_id:'*******',
    method: 'send',
    name: "*****",
    link: 'http://abc.com',
    to:to,
    description:'sdf sdf sfddsfdd s d  fsf s '

});

Upvotes: 0

Views: 1606

Answers (1)

jcolebrand
jcolebrand

Reputation: 16025

in the .cs class:

public string To { get; set; }
...
  To = fr.data[i].name;

in the .asmx page (after all the FB scripts have loaded)

<script>
  facebook_send_message('<%=To %>');
</script>

or if you need the FB scripts to load async and just want to wait a second (can't load with a callback)

<script>
  function sendMessage(){ facebook_send_message('<%=To %>'); }
  setTimeout(sendMessage,1000);
</script>

Upvotes: 1

Related Questions