Determing page redirection through parent page
I have three classes - Employee, Project and TrainingProgram. Then I have a fourth class, TrainingRecord which consists of an Employee, the Project they trained for, the TrainingProgram they completed and the date the开发者_StackOverflow中文版y completed it on.
Users can create new TrainingRecords from two spots - either through an Employee (they select the Project and TrainingProgram, then submit) or through a Project (they select an Employee and a Training Program, then submit).
When inside the Create page for TrainingRecord, what's the best way to tell which parent I came from (the details page of an Employee or the details page of a Project) and how would I redirect the page back to that parent after the new TrainingProgram is submitted?
You could pass a returnUrl
parameter to the controller action which indicates where to redirect to in case of success.
I would've used session variables but you could use querystring as well.
精彩评论