Let's say I have a controller called Pages. In this controller, I have 3 actions: Create, Edit, Details.

In Create and Edit, in addition to the "Save" button, I want to have a "Preview" button, which loads Details in a new tab with the temporary data.

What's the best way to do that?

I thought about using TransactionScope, but how do I share it across multiple requests?

有帮助吗?

解决方案 2

You can just send data by post to controller action, render new details view and post back the page without saving changes to the database. That should work as "preview". You can do this by ajax as well to increase interactivity.

其他提示

You could use jquery window and post there your page's body by simple jquery text() function

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top