Jquery调用C#函数 [英] Jquery call C# function

查看:82
本文介绍了Jquery调用C#函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

[System.Web.Services.WebMethod]
        private void fillfields(string input)
        {
            string constr = ConfigurationManager.ConnectionStrings["DbConnection"].ConnectionString;
            using (SqlConnection connection = new SqlConnection(constr))
            {
                connection.Open();
                using (SqlCommand command = new SqlCommand("TMS_INSERT", connection))
                {
                    command.CommandType = System.Data.CommandType.StoredProcedure;
                    command.Parameters.AddWithValue("@EMP_ID", input);
                    SqlDataReader reader = command.ExecuteReader();
                }
                //myinput1.Value = string.Empty;
                connection.Close();
            }
        }







我的代码有问题,它失败了调用c#函数...



我尝试过的事情:



0000000000000000000000000000000000000000


.

something wrong with my code,it fail to call c# function...

What I have tried:

0000000000000000000000000000000000000000

推荐答案

WebMethods 应该有 public static 签名

WebMethods should have public static signature
public static void fillfields(string input)


这篇关于Jquery调用C#函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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