using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.ComponentModel;

public partial class Chat_ChatControl : System.Web.UI.UserControl
{

    /// <summary>
    /// The Url of the Chat Service handler that services the AJAX requests
    /// </summary>
    [Description("The Url of the Chat Service handler that services the AJAX requests")]
    public string ChatServiceUrl
    {
        get { return _ChatServiceUrl; }
        set { _ChatServiceUrl = value; }
    }
    private string _ChatServiceUrl = "ChatService.ashx";


    protected void Page_Load(object sender, EventArgs e)
    {
        // *** Must assign the target type for the callback control
        // *** otherwise it can't create the proxy
        this.ChatService.TargetCallbackType = typeof(ChatService);
        this.ChatService.ServerUrl = this.ChatServiceUrl;

        if (!this.IsPostBack)
        {
            string ChatId = Request.QueryString["ChatId"];
            if (!string.IsNullOrEmpty(ChatId))
                this.txtChatId.Text = ChatId;
            string Handle = Request.QueryString["Handle"];
            if (!string.IsNullOrEmpty(Handle))
                this.txtName.Text = Handle;
        }

    }
}
