Asp.net中的函数类型 [英] Function types in Asp.net

查看:76
本文介绍了Asp.net中的函数类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

asp.net中有多少种类型的函数以及如何声明用户定义函数,以及如何使用客户端按钮调用函数后面的代码

建议我一些话题?

解决方案

我想你想在用户点击按钮上调用服务器端方法。您需要调用javascript方法来调用服务器端方法。为此,您需要将服务器端方法声明为webMethod。



在此处查找怎么做。


请参阅我对该问题的评论。在客户端和服务器端之间没有呼叫这样的事情 - 你在谈论不同的计算机,不同的无关语言和技术,在一般情况下,使用不同的操作系统。



可能你需要知道的是Ajax:

Ajax(编程) - 维基百科,免费的百科全书 [ ^ ],

Ajax | MDN [ ^ ],

另见 Ajax | jQuery API文档 [ ^ ]。



使用Ajax,您仍然不会调用任何服务器端函数,但您可以向服务器端发送HTTP请求,在那里处理它;成功后,您可以在客户端处理它。这个概念最接近调用函数:您可以在不重新加载页面的情况下从您的请求中获得响应。



-SA

How many types of functions in asp.net and how to declare user define function , and how to call code behind function with client side button
suggest me some topic?

解决方案

I think you want to call the server side method up on user clicking button. You need to call javascript method to call the server side method. For this you need to declare the server side method as webMethod.

Find here how to do that.


Please see my comment to the question. There is no such thing as "call" between client side and server side — you are talking about different computers, different unrelated languages and technologies used in, in general case, different OS.

Probably what you need to know is Ajax:
Ajax (programming) - Wikipedia, the free encyclopedia[^],
Ajax | MDN[^],
see also Ajax | jQuery API Documentation[^].

With Ajax, you still don't call any server-side function, but you can send an HTTP request to the server side, handle it there; on success, you can handle it on the client side. This conception is the closest to calling a function: you get a response out of your request without re-loading the page.

—SA


这篇关于Asp.net中的函数类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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