문제

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