Answer the question
In order to leave comments, you need to log in
How is behavior modularity achieved in ASP.NET MVC?
I have rich experience in developing desktop applications in C# and highly appreciate the charms of the OOP approach.
A production need requires adding a fairly complex (for me) form to an existing asp.net mvc application using a combination of html + js that is still obscure.
The difficulty is to display a list of previously unknown elements, which in the backend are classes inheriting a common base abstract class. Elements can differ quite significantly and fence the garden for all occasions on the main page with checking the type of the list element and a piece of logic responsible for generating the display, I really didn’t want to, and as a result I did it based on ParitalView depending on the element type.
But if something acceptable happened with the display, then I could not understand how to encapsulate the behavior described in JS in each individual element.
Total:
In order to provide all elements with behavior, you have to put all the JS code on a common page.
Is there a way to put JS code in an individual PartialView ?
Perhaps I generally approach the issue from the wrong side, and ask you to poke your nose where it is described how such things are implemented.
The application is written in asp.net mvc 3, aspx, jQuery
Thank you.
Answer the question
In order to leave comments, you need to log in
In order to provide all elements with behavior, you have to put all the JS code on a common page.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question