带Ajax的ASP.NET C# [英] asp.net c# with ajax
本文介绍了带Ajax的ASP.NET C#的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家可以使用AJAX在我的代码后面调用一个函数吗?
如果可能的话,请提供示例,在此先谢谢您!
Hi guys is it possible to call a function in my code behind using AJAX?
Please provide examples if possible, Thanks in advance!
推荐答案
我认为您无法使用AJAX在代码中调用函数.但是您可以使用Sys.Net.WebRequest类与服务器进行通信.
http://msdn.microsoft.com/en-us/library/bb310979.aspx [ ^ ]
I don''t think you can call a function in your code behind with AJAX. But you can communicate with the server using the Sys.Net.WebRequest class.
http://msdn.microsoft.com/en-us/library/bb310979.aspx[^]
是的,您可以使用AJAX访问您的代码隐藏方法(静态Web方法).看看这个
Yes you can access your code-behind methods (static webmethods)using AJAX. Have a look at this article. He is using JQuery and I don''t think that will make a difference to you.
Hope this answers your query!
通过客户端(Javascript)与服务器端进行交互的方法很少:
1. XMLHttpRequest [回调 [ Web服务调用 [ PageMethod [
There are few ways to interact with server side through client side(Javascript):
1. XMLHttpRequest[^]
2. Callback[^]
3. WebService call[^]
4. PageMethod[^]
这篇关于带Ajax的ASP.NET C#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文