Select the product you need help with
How to develop a web chat application by using ASP.NET AJAXArticle ID: 2494268 On This PageINTRODUCTION
This article describes an All-In-One framework sample that is available for download. This code sample demonstrates a step-by-step guide that illustrates how to create a web chat application by using ASP.NET AJAX. You can get the sample package from the download icons below.
Difficulty level
Collapse this image ![]() Download informationTo download this code sample, click one of the following links:Technical overviewYou should have some experience in chatting with friends on the web. You may think it is complicated to develop a web chat application. However, ASP.NET provides an easy and accessible way to do it. The technical overview introduces how to construct a web chat room by using AJAX.The principle controls needed to construct a web chat room by using AJAX are not that complicated. As you know, a web chat application needs the following four basic controls:
Users input a message in the text box, and then they press the Send button. In this situation, the message is sent to the server. The message list is updated every two seconds to get the newest messages in the chat room from the server. It is difficult to make an AJAX web chat application that behaves the same way as a Windows Form application, because you cannot maintain a continuous connection with the server. Therefore, a lot of events that could be immediately communicated between a client and server cannot be realized. The common workaround is to make the web chat application send a request every few seconds to check for server-side updates. Note Before you start to develop a web chat application by using AJAX, you need to have basic knowledge about ASP.NET AJAX, the Windows Communication Foundation (WCF) service, JavaScript (for example, jQuery and Microsoft Ajax CDN), HTML, and CSS. This code sample uses a database to host the chat data, so you also need some knowledge of LINQ to SQL. For more details about these technologies, click the links in the "References" section. Sample OverviewThis code sample is separated into 4 sections:
Data
Logic
Service
User interface
Technology category
LanguagesThis code sample contains the following programming languages:Collapse this table
Prerequisites
MORE INFORMATIONWhat is All-In-One Code Framework?All-In-One Code Framework shows most Microsoft development techniques by using code samples in different programming languages. Each example is carefully selected, composed, and documented to show one common code scenario. For more information about All-In-One Code Framework, visit the following Microsoft website:http://1code.codeplex.com
(http://1code.codeplex.com/)
How to find more All-In-One Code Framework samplesTo find more All-In-One Code Framework samples, search for "kbcodefx" together with related keywords on the Microsoft support Web site. Or, visit the following Microsoft website:All-In-One Code Framework samples
(http://support.microsoft.com/search/default.aspx?query=kbcodefx)
REFERENCES
For more information about how to create an AJAX-Enabled WCF service and an ASP.NET client that accesses the Service, visit the following Microsoft website:
How to create an AJAX-Enabled WCF service and an ASP.NET client that accesses the Service
For more information about the .NET Language-Integrated query for relational data, visit the following Microsoft website:
(http://msdn.microsoft.com/en-us/library/bb924552.aspx)
General information about the .NET Language-Integrated query for relational data
For more information about how to explore rich client scripting by using jQuery, visit the following Microsoft website:
(http://msdn.microsoft.com/en-us/library/bb425822.aspx)
How to explore rich client scripting by using jQuery
For more information about JavaScript Object Notation (JSON) in JavaScript and .NET, visit the following Microsoft website:
(http://msdn.microsoft.com/en-us/magazine/dd453033.aspx)
An introduction to JavaScript Object Notation (JSON) in JavaScript and .NET
For more information about Microsoft Ajax Content Delivery Network (Microsoft Ajax CDN), visit the following Microsoft website:
(http://msdn.microsoft.com/en-us/library/bb299886.aspx)
Microsoft Ajax Content Delivery Network (Microsoft Ajax CDN)
(http://www.asp.net/ajaxlibrary/cdn.ashx)
Rapid publishing disclaimerMicrosoft corporation and/or its respective suppliers make no representations about the suitability, reliability, or accuracy of the information and related graphics contained herein. All such information and related graphics are provided "as is" without warranty of any kind. Microsoft and/or its respective suppliers hereby disclaim all warranties and conditions with regard to this information and related graphics, including all implied warranties and conditions of merchantability, fitness for a particular purpose, workmanlike effort, title and non-infringement. You specifically agree that in no event shall Microsoft and/or its suppliers be liable for any direct, indirect, punitive, incidental, special, consequential damages or any damages whatsoever including, without limitation, damages for loss of use, data or profits, arising out of or in any way connected with the use of or inability to use the information and related graphics contained herein, whether based on contract, tort, negligence, strict liability or otherwise, even if Microsoft or any of its suppliers has been advised of the possibility of damages.Note This is a "FAST PUBLISH" article created directly from within the Microsoft support organization. The information contained herein is provided as-is in response to emerging issues. As a result of the speed in making it available, the materials may include typographical errors and may be revised at any time without notice. See Terms of Use
(http://go.microsoft.com/fwlink/?LinkId=151500)
for other considerations.PropertiesArticle ID: 2494268 - Last Review: January 28, 2011 - Revision: 1.0
|





Back to the top








