Dipende se si consente javascript o no.
Se si consente javascript, utilizzare jQuery per mostrare/nascondere i div.
Ho appena creato il seguente script guidato. Supporta più wizard sulla stessa pagina, a patto che segui la sintassi class/div riportata di seguito.
<div class="wizard">
<div class="step active">
some information
</div>
<div class="step" style="display:none">
Step 2 info
</div>
<div class="step" style="display:none">
Step 3 info
</div>
<input type="button" class="prev" style="display: none" value="Previous" />
<input type="button" class="next" value="Next" />
</div>
<script type="text/javascript">
$(function() {
$('.wizard .prev').click(function() {
var wizard = $(this).parent('.wizard');
$('.step.active', wizard).hide();
var currentStep = $('.step.active', wizard);
currentStep.hide();
currentStep.removeClass('active');
var newStep = currentStep.prev('.step', wizard);
newStep.addClass('active');
newStep.show();
if ($('.step:first', wizard)[0] == newStep[0]) {
$(this).hide();
}
$('.next', wizard).show();
});
$('.wizard .next').click(function() {
var wizard = $(this).parent('.wizard');
$('.step.active', wizard).hide();
var currentStep = $('.step.active', wizard);
currentStep.hide();
currentStep.removeClass('active');
var newStep = currentStep.next('.step', wizard);
newStep.addClass('active');
newStep.show();
if ($('.step:last', wizard)[0] == newStep[0]) {
$(this).hide();
}
$('.prev', wizard).show();
});
});
</script>
Senza javascript:
Creare un modello di vista, che contiene le informazioni per tutte le misure e condividerla tra tutte le viste passaggio della procedura guidata. Ciò consente di mantenere tutti gli stati tra i diversi POST.
Il collegamento di Darin a un esempio fornito in risposta è stato molto utile per aiutarmi a creare i maghi in MVC. – REMESQ
@REMESQ - un modo così lungo per dire 'Grazie, che ha aiutato'. – Dementic