Plz帮助我想从数据库获取数据使用Javascript C#获取函数 [英] Plz Help I Want To Data Fetch From Database Onclick Function Using Javascript C#

查看:70
本文介绍了Plz帮助我想从数据库获取数据使用Javascript C#获取函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

PLZ帮助我想使用javascript从数据库onclick函数获取数据c#

plz help i want to data fetch from database onclick function using javascript c#

推荐答案

您可以从javascript调用Web服务。请查看以下文章。

在规则的时间间隔内使用JavaScript调用ASP.NET Webservice [ ^ ]



你可以避免文章中的代码,因为这不是在你的情况下需要。

You can call the web service from javascript. Please check the article below.
Calling ASP.NET Webservice using JavaScript on Regular Interval of Time[^]

You can avoid below code in the article, as this would not be required in your case.


(document).ready(function(){
setInterval( CallWebService() 2000 );
});
(document).ready(function () { setInterval("CallWebService()", 2000); });


请参阅使用jquery或javascript,您可以调用webmethod这是对服务器的ajax调用。在该web方法中,您可以获取数据并将表保存在数据集中并从该web方法返回ds.GetXml()。



你将在你的javascript中获取表格,然后你就可以用这些数据做任何你想做的事。



使用
See using jquery or javascript you can call webmethod which is a ajax call to the server.In that webmethod you can fetch the data and keep the table in dataset and return ds.GetXml() from that webmethod.

and you will get table(s) in your javascript and then you can do whatever you want with that data.

use


这篇关于Plz帮助我想从数据库获取数据使用Javascript C#获取函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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