I am making a ASP.Net Dynamic Data website where I have one table, Orders, and another table, OrderLines. The Orderlines table has an FK-relationship back to Orders. This means that one Order may contain zero or more OrderLines.
The default workflow offered by Dynamic Data will let me do this:
- Go to the list of Orders, click "add new row", fill in information, and click Insert.
- Click on "View OrderLines" in the list of orders. This takes me to an empty list of OrderLines for this particular Order. This is what I want.
- Clicking on "Add new row" lets me add one orderline for this particular order. The URL reflects this by saying fk_OrderID=nnn. The correct order description is pre-selected.
- Now, clicking either Insert (adding one orderline), or Cancel, takes me back to the list of OrderLines for all existing orders. Not what I want!
The workflow I want to have, is one where I can keep adding orderlines until I am done. This means the Insert and Cancel redirects should go back to the list of orderlines for the particular order that I am working on.
So, my question is this:
How can I customize the ASP.Net routing mechanism in Global.asax.cs so that Dynamic Data will redirect the way I want it to?
I am using Dynamic Data Preview 4 refresh 7/24 with Linq to SQL.