Not working is a problem description that's more adapted to people that don't know/care about how computer works and not software developers. Software developers usually describe precisely the problem they are having. They post the exact error message/exception stack trace they are having.
This being said you are asking for alternative solutions, here's mine: don't use any MS Ajax.* helpers
, use jquery directly and unobtrusively, like this
<script type="text/javascript">
$(function () {
$('#confirmation').hide();
$('form').submit(function() {
$('#confirmation').show('slow');
$(this).hide('slow');
return false;
});
});
</script>
@using (Html.BeginForm())
{
<fieldset id="contactForm">
<legend>Message</legend>
<p>
@Html.Label("Email", "Email"):
@Html.TextBox("Email")
</p>
<p>
@Html.Label("Subject", "Subject"):
@Html.TextBox("Subject")
</p>
<p>
@Html.Label("Message", "Message"):
@Html.TextArea("Message")
</p>
<p>
<input type="submit" value="Send" />
</p>
</fieldset>
}
<p id="confirmation">
Thanks!!!
</p>
Notice how the confirmation
paragraph has been externalized from the form.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…