Dynamically load Layout - or load previous layout instead of default layout

My application has several groups of functionality (groups of related views and controllers) which I called modules.
Each module will load a different layout. It work fines as it should be.

However, I have 1 common functionality which allows Users to add comment / bug reports (I called it AppComments). It is a controller and models, it has several views by itself.
The issue is that these views of this function will have to load a Layout. Once user go to one of the Views, the layout is changed, and it does not make sense anymore.

Example:

  • Module A use Layout A which has links to all functionalities of module A. Layout A also has links for AppComments functions.
  • Module B use Layout B which has links to all functionalities of module B. Layout B also has links for AppComments functions.
  • Suppose that AppComments use Layout B. If user access AppComments function from Module A, layout will be changed to Layout B, user will lose all the links of module A, and user may get lost in navigation.

I have think of using session variable to store current layout name, but then it need to set in every view and seem not to be efficient way.

Is there any better way of this? Can I load current layout (Layout A from module A, or layout B from module B) instead of default layout?