本文介绍了如何从客户端调用Asp .net服务器端方法(Javascript)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好

我是Asp .net的新手.
谁能告诉我如何从客户端(Javascript)调用服务器端方法.
在此先感谢.

Hello All

I am new to Asp .net.
Can anyone tell me How to call the Server side method from client(Javascript).
thanks in advance.

推荐答案

[WebMethod]
   public static string AddUser(string UserName)
{
..
body of the method
..
}



那么您可以像这样从ur javascript中调用该函数.
在javascript中..


PageMethods.AddUser(



then you can call the function from ur javascript like this..
inside the javascript ..


PageMethods.AddUser(




这篇关于如何从客户端调用Asp .net服务器端方法(Javascript)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-20 05:30
查看更多