Reputation: 8488
We're developing a site initially without javascript for maximum support with the intention of layering js functionality over the top. The problem we have is where a single page has 2 or more pieces of functionality (as an example a screen to capture personal details that includes a postcode lookup for address). With no ability to change the postback on either the complete form submission or a postback to lookup a postcode we end up with a single controller action that does both. This doesn't feel great as we end up with an Index Action doing more than one thing. Given a js enabled client this would be separated out nicely into separate actions.
I was wondering if anyone else has faced this issue of producing a javascript free ASP.MVC site and what pattern you used to overcome Controller Action bloat as we're calling it?
Upvotes: 2
Views: 2812
Reputation: 36037
A couple options.
Upvotes: 2
Reputation: 30160
I've done this specific example (postcode lookup) a couple of times recently and made the decision that users with no Javascript just wouldn't get that functionality. They would get the full address form, which I would then hide and replace with postcode and lookup link via Javascript.
Not an answer to your overall question, but perhaps something to think about.
Upvotes: 0