How to Develope Chatting Application

Last post 07-05-2009 3:59 AM by Shengqing Yang - MSFT. 5 replies.

Sort Posts:

  • How to Develope Chatting Application

    07-04-2009, 8:49 AM
    • Member
      2 point Member
    • dotnetdouts
    • Member since 05-18-2009, 3:07 AM
    • Posts 56

     Hi,

    I nee to develope chatting application.

    My requirement is In my webapplication I have a Link called "Live Chat" .

    When user click on "LiveChat" he can able to chat with admin.

    Pls suggest me how to do effectively.

     

    Thanks

    Thanks
    EducateMeFoundation
    http://www.educateme.in
  • Re: How to Develope Chatting Application

    07-04-2009, 9:07 AM
    Answer
    • Member
      421 point Member
    • Deeno20
    • Member since 03-25-2009, 7:21 AM
    • Kumavat
    • Posts 217

    this link will help u just go  trhrough this

    http://www.codeproject.com/KB/applications/AliAspNetChat.aspx

    http://cutesoft.net/ASP.NET+Chat/default.aspx

    Happy TO Help
  • Re: How to Develope Chatting Application

    07-04-2009, 9:18 AM
    Answer

    did you try googling? There are loots of help resources available on this.

    create chat application in asp.net - Google Search

    one of them is:

    Simple Chat Application in ASP.NET.


    common trend is to add a third party service to application like SightMax (i used it and quite easy), Netop, BoldChat etc....

    if using third party service, you just need to install server and operator setups, defining VDs in your websites, creating operator logins, sales ques to perticular website.

    hope it helps./.

    नमस्ते,
    [KaushaL] || BloG || MS MVP

    "I would love to change the world, but they won’t give me the source code"


    Don't forget to click "Mark as Answer" on the post that helped you.
    This credits that member, earns you a point and mark your thread as Resolved for the sake of Future Readers.
  • Re: How to Develope Chatting Application

    07-04-2009, 10:57 AM
    • Member
      80 point Member
    • hminaya
    • Member since 10-17-2008, 3:04 AM
    • Dominican Republic
    • Posts 31

     There are a lot of samples out there on how to do this, try using bing.com and doing a couple of searches, I'm sure you'll find everything you need there...

    Hector Minaya
    Microsoft Visual Basic MVP | Speaker INETA - Latam | MCSD | MCT | MCTS : SQL Server
    blogs: Hector Minaya | DotNetNuke SEO | Blogger SEO | facebook junkie | SEO Tools
  • Re: How to Develope Chatting Application

    07-04-2009, 12:08 PM
    • Member
      172 point Member
    • rickj1
    • Member since 12-17-2007, 4:49 AM
    • Parksville B.C.
    • Posts 89

     This is a simple chat room no data base place it in a admin folder it comes from the book ASP.Net Step by Step I have a couple of them on my sites the work fine for what I need them for

    hope this helps don't forget to mark as answer

    Put this is a aspx page

    <asp:Timer ID="Timer1" runat="server" Interval="15000">
        </asp:Timer>
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
        <h1>Welcome to bed bug chat</h1>
        <h3>
            Group Chatting...Tell others what worked for you. There is nothing to install just
            enter your name</h3>
           <asp:Label ID="Label2" runat="server" CssClass="M " Text="Enter your name for chat session: "></asp:Label>
        <asp:TextBox ID="TextBoxUserID" runat="server" Width="244px" TextMode="SingleLine"></asp:TextBox>
        <asp:Button ID="ButtonSubmitID" runat="server" OnClick="ButtonSubmitID_Click" Text="Submit ID"
            Width="101px" />
        <br />
        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <ContentTemplate>
                <asp:TextBox ID="TextBoxConversation" runat="server" Height="156px" ReadOnly="True"
                    TextMode="MultiLine" Width="748px" CssClass="textbox" Wrap="True" BackColor="#CCFFFF"
                    BorderColor="#9933FF" BorderStyle="Groove" BorderWidth="40px" ForeColor="Black"></asp:TextBox>
            </ContentTemplate>
            <Triggers>
                <asp:AsyncPostBackTrigger ControlID="Timer1" EventName="Tick" />
            </Triggers>
        </asp:UpdatePanel>
        <asp:Label ID="Label1" runat="server" CssClass="M" Text="Type your message here: Double click in the test box to view your input"></asp:Label>
        <br />
        <asp:TextBox ID="TextBoxMessage" runat="server" Width="750px"></asp:TextBox>
        <br />
        <asp:Button ID="ButtonAddYourMessage" runat="server"
            Text="Add Your Message" BorderWidth="8px" BorderStyle="Groove" BorderColor="#FF66FF"
            BackColor="#FF0066" ForeColor="Black" Width="200px" Font-Underline="True" Font-Bold="True"
            Font-Size="Large" Font-Italic="True" OnClick="ButtonAddYourMessage_Click"/>
        <asp:Button ID="Button1" runat="server" Text="Home" BorderWidth="8px" BorderStyle="Groove"
            BorderColor="#FF66FF" BackColor="#FF0066" ForeColor="Black" PostBackUrl="Default.aspx"
            Width="200px" Font-Underline="True" Font-Bold="True" Font-Size="Large" Font-Italic="True" />

     

    Put this in your code behind

     

     protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
                TextBoxConversation.Text = "Welcom to barterlinks";
            ManageUI();
            RefreshConversation();
        }

        void ManageUI()
        {
            if (GetUserID() == null)
            {
                // if this is the first request, then get the user's ID
                TextBoxMessage.Enabled = false;
                TextBoxConversation.Enabled = false;
                ButtonAddYourMessage.Enabled = false;

                ButtonSubmitID.Enabled = true;
                TextBoxUserID.Enabled = true;
            }
            else
            {
                // if this is the first request, then get the user's ID
                TextBoxMessage.Enabled = true;
                TextBoxConversation.Enabled = true;
                ButtonAddYourMessage.Enabled = true;

                ButtonSubmitID.Enabled = false;
                TextBoxUserID.Enabled = false;
            }
        }


        void RefreshConversation()
        {
            List<string> messages = (List<string>)Cache["Messages"];
            if (messages != null)
            {
                string strConversation = "";

                int nMessages = messages.Count;

                for (int i = nMessages - 1; i >= 0; i--)
                {
                    string s;

                    s = messages[i];
                    strConversation += s;
                    strConversation += "\r\n";
                }

                TextBoxConversation.Text =
                    strConversation;
            }
        }

        protected void ButtonAddYourMessage_Click(object sender, EventArgs e)
        {

            // Add the message to the conversation...
            if (this.TextBoxMessage.Text.Length > 0)
            {
                List<string> messages = (List<string>)Cache["Messages"];
                if (messages != null)
                {
                    this.TextBoxConversation.Text = "";

                    string strUserID = GetUserID();

                    if (strUserID != null)
                    {
                        messages.Add(strUserID +
                            ": " +
                            TextBoxMessage.Text);
                        RefreshConversation();

                        TextBoxMessage.Text = "";
                    }
                }
            }
        }
        protected void ButtonSubmitID_Click(object sender, EventArgs e)
        {
            Session["UserID"] =
                TextBoxUserID.Text;
            ManageUI();
        }

        protected string GetUserID()
        {
            string strUserID =
                (string)this.Session["UserID"];

            return strUserID;
        }

     

    add a Global.asax remove every thing and place this in it

     

    <%@ Application Language="C#" %>
    <%@ Import Namespace ="System.Collections.Generic" %>

    <script runat="server">

        void Application_Start(object sender, EventArgs e)
        {
            // Code that runs on application startup
            List<string> messages = new List<string>();
            HttpContext.Current.Cache["Messages"] = messages;

        }
       
        void Application_End(object sender, EventArgs e)
        {
            //  Code that runs on application shutdown

        }
           
        void Application_Error(object sender, EventArgs e)
        {
            // Code that runs when an unhandled error occurs

        }

        void Session_Start(object sender, EventArgs e)
        {
            // Code that runs when a new session is started

        }

        void Session_End(object sender, EventArgs e)
        {
            // Code that runs when a session ends.
            // Note: The Session_End event is raised only when the sessionstate mode
            // is set to InProc in the Web.config file. If session mode is set to StateServer
            // or SQLServer, the event is not raised.

        }
          
    </script>

     

     

    Beta Junky
    www.barterlinks.net
  • Re: How to Develope Chatting Application

    07-05-2009, 3:59 AM
    Answer

    dotnetdouts:

    I nee to develope chatting application.

    If you need to build a chat feature using ASP.Net, I would like to suggest you having a look at this existed thread answered by Lance Zhang - MSFT: http://forums.asp.net/t/1371574.aspx. It gives five choices to make it.

    Actually, if you make a search using google, you will find thousands of samples on the internet, like this: http://www.codeproject.com/KB/ajax/ChatRoom.aspx.

    Best Regards,
    Shengqing Yang

    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread : )
Page 1 of 1 (6 items)