Try our conversational search powered by Generative AI!

Block actions - where to put them?


Where is the 'correct' place to put actions for a block?

I've been playing around with having actions in the block controller. Problem is I don't seem to be able to post a form to the action directly because of the block not having its own url. Added a default route for {controller}/{action} but I don't think it's a great idea since the action doesn't get the currentPage data.

Another solution I was thinking about was to put the block actions in a base controller that all page controllers inherit from. That way all pages have the actions for all blocks. Not a good solution when having many blocks...

How is this normally solved?

Jun 04, 2014 15:12

How about Web API and jquery combo?

Jun 04, 2014 15:34

Of course that's one way of doing it, it won't add any advantages over adding a default controller/action route and use the block controller. I would still need to post one or more params to be able to lookup currentPage or currentBlock.

Jun 05, 2014 12:44
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.