As I am new to MVC 3 development I need some advice on the best approach to a development task I am currently working on.
I am currently developing a payment forms application for the payment of various programmes eventually this will include a reasonable number of programmes most of which have at least three ways they can be paid (full payment, deposit and remainder – some also include discounts and a few can only be paid in full).
I need to decide on a best method for implementing a routes based strategy which will allow users to enter specific URLs for the programme they are looking to pay for, essentially all of the programmes require the same information to be entered the only differences being the cost of each programme and the date or dates that programme runs on.
I am trying to decide whether it would be better to have multiple views for each programme and then enter routes for each separate programme (I currently have over 30 programmes this includes full, deposit and remainder and a couple of discounts as well – this is likely to increase) or if it is possible to use routes to generate specific information for each programme in a single view so that I don’t have to replicate essentially the same code for 30+ views and controllers.
Thanks for the reply I worked it out the other day I have put the route in a foreach loop which generates the URL on the fly the route I have used is this:
the programme.Code ensures that each time the loop is run that the route name is unique, I am picking up the specific URL from the database