0
我用这CCODE现在..
<%using (Html.BeginForm("SaveNewServiceTypeCategory","ServiceTypeCategory")){ %>
<table>
<tr>
<td>Service type category:</td>
<td style="padding-left:5px;">
<input type="text" id="txtNewServiceTypeCategory" name="txtNewServiceTypeCategory" style="width:400px;" maxlength="30" />
</td>
</tr>
<tr>
<td valign="top">Service type description:</td>
<td style="padding-left:5px;">
<textarea id="txtNewServiceTypeCategoryDesc" name="txtNewServiceTypeCategoryDesc" style="width:400px;" rows="3"></textarea>
</td>
</tr>
<tr>
<td colspan="2">
<input type="submit" value="Save"/>
</td>
</tr>
</table>
<%} %>
但我需要显示时添加到数据库中的数据弹出消息..
我写了somethign这样
$(function() {
$('#form1').submit(function() {
$.ajax({
url: , how to give the URl here?
type: this.method,
data: $(this).serialize(),
success: function() {
alert("Saved Successfully!");
}
});
return false;
});
保存后需要显示保存成功的消息给用户?
谢谢 });
感谢您的更新。它做得很好,但它并没有保存到我的数据库中,但它的提示信息已成功保存? – kumar 2010-09-20 19:02:12
也许问题出在你的控制器动作上。你有没有尝试通过代码来验证发生了什么? – 2010-09-20 19:12:21
是的,我没有得到我存储在控制器中的值? – kumar 2010-09-20 19:14:35