views:

117

answers:

1

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:

  1. Go to the list of Orders, click "add new row", fill in information, and click Insert.
  2. 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.
  3. 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.
  4. 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.

A: 

I don't think this would be a change in the routing. What you might do is override the default "Insert" page with your out Custom page. The Custom Page would look to see if any QueryString parameters were sent to it, and redirect back to the "List" page accordingly.

Aaron Hoffman

related questions