从ASP.NET $ C与JavaScript $ C文件调用函数 [英] Calling functions from an ASP.NET code file with javascript
本文介绍了从ASP.NET $ C与JavaScript $ C文件调用函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个基于JavaScript的时间表,需要从一个SQL服务器使用的数据。查询和JSON的转换已经制定了在C#.NET函数的形式中涉及到一个.aspx页面中的code文件。
I have a JavaScript-based timeline which needs to use data from an SQL server. The queries and the JSON conversions have been worked out in the form of C#.NET functions within a code file related to an .aspx page.
因此,对于一个完整的新手到ASP.NET,你如何建立一个函数调用像这样从JavaScript?
So for a complete newbie to ASP.NET, how do you set up a function call like this from JavaScript?
我会喜欢它,如果有人有一些简单的例子,code,我可以学到/获得一些指针从。
I would love it if someone had some simple example code I could learn/get some pointers from.
编辑:我使用.NET 3.5
I am using .NET 3.5
推荐答案
这是我如何做到这一点使用jQuery
This is how I do it with jQuery
$.getJSON("MyAction" { Data: somedata}, function(data) {
// do stuff on callback
});
这篇关于从ASP.NET $ C与JavaScript $ C文件调用函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文