简体   繁体   English

如何使用asp.net向用户发送私人消息?

[英]How to send private message to user using asp.net?

在此处输入图片说明

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 当用户单击与用户相对应的邀请按钮时,我正在尝试在asp.net中实现类似的操作,并使用他/她的姓名填充发送对话框,并可以发送消息

How do i do this in asp.net ? 我如何在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 编辑:好吧,我已经成功获取了此弹出窗口,但是我想在“ 收件人”字段中填充我要邀请的朋友的名字。该消息将作为Facebook消息发送

ASPX.CS 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: 我如何将其传递给我的客户端Facebook功能,如下所示:

 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 '

});

in the .cs class: 在.cs类中:

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

in the .asmx page (after all the FB scripts have loaded) 在.asmx页面中(加载了所有FB脚本之后)

<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) 或者如果您需要FB脚本加载异步并且只想等待一秒钟(无法加载回调)

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM