通过调用一个JavaScript服务器端功能 [英] Calling a server side function using a javascript

查看:101
本文介绍了通过调用一个JavaScript服务器端功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要调用当一个项目被挑中的ASP下拉框中选择一个服务器端的功能, 是否有人可以告诉我该怎么做?

I need to invoke a server side function when an item is picked in an ASP drop-down box, Can someone please tell me how to do that?

推荐答案

在ASP.NET中使用下拉选择指数的变化情况。或者对客户端的事件,你可以使用jQuery,然后使用下面的JavaScript函数连接到服务器:

Within ASP.NET use the drop down selected index change event. Alternatively for a client side event you could use JQuery and then use the following JavaScript function to contact the Server:

function CallServer() {
    $.ajax({
        url: 'webserviceURL',
        type: "POST",
        datatype: "json",
        success: function (result) {
            if (result.Success) {

            } else {

            }
        }
    });
}

这篇关于通过调用一个JavaScript服务器端功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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