views:

287

answers:

1

Hi all,

I've got a really odd problem when using N2 with MVC. It seems to be related to the N2 side of things, as it doesn't happen within a purely MVC only app I wrote to test. Basically, when making calls to controller actions from within a page, the controller action parameters act as if they're being cached if they get called more than once.

As an example, I have articles that contain comments. If a user wishes to add a comment, a call is made to the AddComment action method of the CommentController. The first time a user adds a comment, this works fine. However, every subsequent call to that same routing path, with a different set of parameters (ie - someone puts another, different comment), the parameters that end up being passed to the AddComment action are exactly the same as the very first time it was called.

The only way to stop this is to basically kill the app and restart it. Then, when someone adds a comment, as before, it'll work fine, but all subsequent comments end up being the same. I'm totally out of ideas as to why this might be happened.

Does anyone have any ideas as to why this might be?

Many thanks.

+2  A: 

Found the answer finally. We'd been using Castle to handle dependencies, and hadn't set any of the controllers to be transient. Doh!

Chops