How to implement chat application in C# MVC?

Which is better for my requirements - ASP.NET webforms or ASP.NET MVC?

  • I will build a web application, and since I'm an http://ASP.NET developer, I have pondered the question of webforms vs http://en.wikipedia.org/wiki/ASP.NET_MVC_Framework. Please advise which is better, considering the app will feature: - User profiles, user rating system - 1 vs 1 text chats - 1 vs 1 video chats - must be very high quality - A user dashboard composed of panels, much like netvibes panels (http://www.netvibes.com/privatepage/1#Computer). - The panels will be used to show the chats (text or video), and the user must be able to take objects from a side panel, and drag and drop them in the chat window. (The receiving panel has to use the objects in further events.)         I should also mention that the application must be: -  Easy to maintain, easy to add new functionality -  SEO-friendly (although not an issue, webforms also received URL Routing) -  I've always coded in webforms, but if http://en.wikipedia.org/wiki/ASP.NET_MVC_Framework is really a lot better for my requirements, then I'll pick it (although time required for actually learning http://en.wikipedia.org/wiki/ASP.NET_MVC_Framework is also an issue to consider). - Last but not least, I don't want to reinvent the wheel, are there any open source components already available that fulfil any of the above requirements? I know Telerik has some nice ones, but they cost a lot, so for my budget I definitely need something open source that's customizable. I'm also thinking that, because http://en.wikipedia.org/wiki/ASP.NET_MVC_Framework is still relatively new, I probably won't find that many resources to build all this, whereas for webforms there are zillions. But if really is a lot better, and the learning curve is not that big, I'll choose http://en.wikipedia.org/wiki/ASP.NET_MVC_Framework.

  • Answer:

    I will prefer http://ASP.net MVC, because 1. It gives more flexibility and separation between the code and HTML. Designers and developers can work at the same time without stepping onto the each other's code. 2. There are many code examples and developers who are currently working in MVC and they can help you if you come across any issues during coding. 3. Your HTML code will look clean and will provide more options to work with Raw HTML. In webforms http://ASP.net engine creates its own ids, html when you use  ascx controls and other build in controls. 4. Integration of javascript libraries are easy in MVC.

Gaurav Sharma at Quora Visit the source

Was this solution helpful to you?

Other answers

MVC is a more natural way of developing a website. The original http://ASP.NET Web Forms is really a hack design originally meant to lore WinForms developers over to the web. Once you start programming in the MVC model you will think back to you're WebForm developing days as when you were "slumming it".

Jake Hoffner

Have you ever taste ASP .NET webform MVVM with http://www.irwsoft.com/Irwsoft.Web.Controls/ . Usually people choose ASP .NET MVC because of common reasons like good layering/structure, testability and etc. Using http://www.irwsoft.com/Irwsoft.Web.Controls/ also you can create programming model simple and testability. Because you don't need to care about UI, it is handled by http://www.irwsoft.com/Irwsoft.Web.Controls/. All you need to do is just create your ViewModel and your database layer, where you can design them testability also.

Zhao Yun

depends on the requirement. If you want the job done quickly, webforms is the answer. If you want to have more control over the UI then http://ASP.NET MVC is the best. I work on both. You can still use the webforms controls in MVC. All you have to do is select ASPX engine, when you create the MVC project.

Venkata Aditya Korada

http://Asp.net MVC is far more easy to develop & let you know all logic behind the scene (e.g routing , events , states etc..)  as compare to web forms. Also mvc is easy to maintain & more features can be added to project easily.. Moreover learning MVC will let you know more about the architecture i.e model view controller which is used by many other technologies like ruby on rails , python & others....

Mohit Verma

Neither!From the details you’ve provided it seems like perfect candidate from SPA (Single Page Application), where all the rendering is done on the client side by javascript frameworks (React, Angular) and you communicate with web server only using rest api (WebApi) and web sockets (SignalR).You’ve mentioned things like chats, panels with dynamic content drag and drops All of the features requires ajax functionality and the less server side logic will be involved, the easier it will be.You probably don’t like javascript. You think it’s leaky and hard to maintain. But a lot has changes in past few years. EcmaScript 6 compiled to ES5 solves most of the javascript problems with organizing code and scopes. TypeScript solves the problem with maintenance and refactoring. Unlike CofeeScript or Dart, TypeScript is not a new language. It’s just javascript, where you can anotate variables types. thats all, but extremly powerfull. React is rendering framework, just like razor in MVC, but it’s all done in ine browser by javascript. I would say it combines best from Razor and WebForms. You write self contained components or you can use 3rd party components just like in webforms, but you can databind them just like in webforms. React+TypeScript is mindblowingly powerfull combination. Not only your javascript logic, but also your views will be typesafe and refactorable. Actually it will type-safer than C# code with html rendering done in razor or webforms. With SPA approach you will end up with much better result. The learning path will be longer, it will be much harder for you, but it will open you doors do the new world with unbelievable possibilities. You should become familiar with NodeJS and NPM as a build tools.However, if you must choose between MVC and WebForms, choose MVC, otherwise you will regret. MVC is really simple concept, there not so much to learn, if you are already familiar with http://asp.net already. The harderst for you will be stop thinking in an webforms way of solving problems.

Daniel Turan

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.