Вопрос

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