As a .NET WPF developer what are key differences I should be aware of when working with ASP.NET MVC? [closed]

I’m a fairly experienced desktop .NET developer with a solid feel for MVVM and WPF, and I’ve worked with JavaScript, jQuery and HTML/CSS in the past – though I’m pretty dated and haven’t had a ton of experience with the new frameworks (Angular, et al).

My question is, for anyone who has had to do it, what are the key pain points and differences I should be aware of when working on an ASP.NET MVC project?

I have a general sense of the MVC pattern and where it differs from MVVM, but ASP.NET tricks me by looking familiar, but with subtle and not-so-subtle differences in implementation and execution. I’m helping out with an ASP.NET project at work, and while my C# knowledge helps, my desktop habits seem to be a liability. Links to material I can review would be appreciated, or a succinct summary of what I need to change about my mindset.

1

I went from MVC to MVVM and found that the main difference is that with MVC you deal with a single request from Controller to Model to View over and over, which you can turn into a single-page type app with AJAX.

In MVVM, the async of data/view is taken care of via properties notifying anything bound to them that the value has changed. Your Views can refresh themselves without having to re-do the entire MVC call and re-draw everything – instead only the affected properties are re-drawn so to speak.

I’ve found the async nature of MVVM to be favorable over MVC. The biggest hurdle for me has been trying to adhere strictly to MVVM pattern and not putting code in View Code-Behind or make Models/VMs aware of any Views etc. For smaller projects, it doesn’t really matter.

Over-simplified example:

MVC: $user submits login request through controller, controller builds new View with $user defined from Model

Controller [$msg = Hello, $user!] => Model [$user = Bob] => View ["Hello, Bob!"]

MVVM: $user submits login request through view, view model updates property with $user defined from Model, Property Notifies View that it has changed and View is updated (without having to re-draw or re-submit the entire process)

ViewModel [$msg = Hello, $user!] => Model [$user = Bob] => View ["Hello, Bob!"]

1

It’s a totally different beast. WPF is all about binding your ViewModel with the views using XAML. There are frameworks (I think Caliburn Micro is the one I used once) that help building this bridge automatically hence allowing you to reuse more code.

On the other hand, ASP MVC is about using a template for your C# objects, but once your page has been served, you usually need more programming on the client side. Name it JQuery, Knockout, AngularJs, etc. This way you can make bindings for each control, kind of what XAML does, but with more power in my opinion.

As you learn more about how http request/response cycle works, believe me, you will crave more and more programming in the browser and less on ASP side. At least that was what happened to me. Nowadays I use C# as a console application to serve/recieve JSON, serialize/deserialize and read/write in databases. Even the attempt to put logic on ASP views is not appealing to me anymore. Plain HTML happens to be a great fit for javascript without the need of server templating.

2

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật