3

私は次の問題を抱えています:

一種のチャットアプリケーションを実装する必要があります。したがって、ASP.NET4.5とWCFを使用します。チャットしたい相手をクリックし始めると、wcfWebサービスに電話します。このWebサービスは、クリックした人からwcfコールバックを呼び出します。私の問題は、クライアント側でイベントが呼び出されることですが、新しいチャットウィンドウを開くことができません。

[CallbackBehavior(UseSynchronizationContext = false, ConcurrencyMode = ConcurrencyMode.Single)]
public class ChatContext : IChatClient, INotifyPropertyChanged
{
    #region Events

    public event EventHandler StartChat;

    #endregion


    public void FollowChatBegin(Person invitee)
    {
        StartChat(invitee, new EventArgs());
    }

メインページにStartChatイベントを登録しました。

 public partial class MainPage: System.Web.UI.Page
{       

    protected void Page_Load(object sender, EventArgs e)
    {
       // ...

        Global.ChatContext.StartChat += ChatContextOnStartChat;
    }

 private void ChatContextOnStartChat(object sender, EventArgs eventArgs)
    {
        var person= (Person) sender;

        string path = this.Request.Url.AbsoluteUri.Remove(this.Request.Url.AbsoluteUri.IndexOf(Request.Url.LocalPath, Request.Url.LocalPath.Length));
        path += "/Controls/Chat/ChatWindow.aspx";

        string parameters = "did=" + person.Id + "height=700px,width=800px,resizeable=yes,status=no";
        path += parameters;

        ScriptManager.RegisterStartupScript(this, this.GetType(), "openChartWindow", "window.open('" + path + "');", true);

        this.upMain.Update();
    }

}

ChatContextOnStartChatにより、次の問題が発生します。

  • this.Requestはnullです
  • UpdatePanel.Updateを呼び出せません

ポップアップ/ダイアログを単純に開く方法がわかりません...間違ったパターンを使用できますか?

4

0 に答える 0