2

I'm using the excellent Magellan navigation framework from Paul Stovell.

When you have this method in the controller

Public Function Save(ByVal Contact As Contact) As ActionResult
    Try
        Contact.Save()
        Return Index() ''//Call other action result that brings the list of contacts
    Catch ex As Exception
        Return New CancelResult
    End Try
End Function
  1. Is there a way that Index does not create another view, but navigate to the existing one (if exists)?
  2. Is there a way to destroy a View (in this case, the contact view, which is not longer valid because the record is already saved in the DB)
Dave Clemmer
  • 3,741
  • 12
  • 49
  • 72
Eduardo Molteni
  • 38,786
  • 23
  • 141
  • 206
  • Hi Eduardo, what kinds of views are you using? Are they Windows or pages? By reusing the view, do you mean to re-focus on the view? Let me know and I'll show how a ViewEngine can be used to achieve this. – Paul Stovell Nov 25 '09 at 22:46
  • I'm using pages and yes, re-focus in the view (going back or forward in the navigation). – Eduardo Molteni Nov 26 '09 at 04:53

1 Answers1

3

You may be able to accomplish this using the Action and Result Filters feature:

http://www.paulstovell.com/magellan-action-and-view-filters

You could use OnResultExecuted to track the page that was rendered. Then you could handle OnResultExecuting to see the target page - if it's a page that exists in the navigation journal, you could issue GoBack/GoForward commands to navigate back to the page.

Paul Stovell
  • 32,377
  • 16
  • 80
  • 108