If you plan to do AJAX, I would do it from the very beginning. This will help you structure the actions and views of the controller, especially in terms of generating some data in partial views, right from the start. Knowing that some actions should be able to display only parts of the page will change your design. This does not mean that you cannot go back and modify the design, but I think it is easier to get the design right if you design it with this in mind. You should also consider how to make it work without AJAX (or javascript in general) so that your design is as safe as possible. This does not mean that all functions should be available, but this important functionality works in the absence of javascript. For example, action links that use AJAX should have a default URL that will trigger the correct action using a GET request if javascript is not enabled. Forms that are published through AJAX should also work if they publish normally. Dynamic behavior (e.g. image gallery) should have a useful alternative representation that works, etc.
tvanfosson
source share