没有页面刷新插入/从数据库中选择。 [英] Without page Refresh insert/select from database.

查看:41
本文介绍了没有页面刷新插入/从数据库中选择。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用c#和sql server在asp.net中插入/选择/删除而不刷新漏洞页面。

How to insert/select/delete in asp.net using c# and sql server without refresh the hole page.

推荐答案

为此你必须使用jQuery Ajax启用页面。



For that you have to use jQuery Ajax enabled page.


.ajax({
url:'http:/ / localhost:60792 / api / student /',
类型:'POST',
数据:JSON.stringify(学生),
contentType:application / json; charset = utf-8 ,
成功:函数(数据){
alert('学生成功添加');
},
错误:function(){
alert('Student没有添加');
}
});
.ajax({ url: 'http://localhost:60792/api/student/', type: 'POST', data: JSON.stringify(student), contentType: "application/json;charset=utf-8", success: function (data) { alert('Student added Successfully'); }, error: function () { alert('Student not Added'); } });





如需了解更多信息,请查看: jQuery.ajax()



我希望这会对你有所帮助。



For more info check this : jQuery.ajax()

I hope this will help to you.


使用 AJAX [ ^ ]或 jQuery [ ^ ]


这篇关于没有页面刷新插入/从数据库中选择。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆