医药CRM系统开发

自已做医药CRM系统有四年了,终于可以算个产品了,努力市场化,今年重种将医药营销的理念加入CRM

导航

使用ajax调用WebService函数

Posted on 2008-03-16 09:30  hhq80  阅读(277)  评论(0编辑  收藏  举报
        string js;
        js = "";
        js += "function CallWebServices(){";
        js += "AutoComplete.GetLoginUserCount(onOK);";
        js += "}";
        js += "function onOK(returnData){";
        js += "$get('TextBox1').value=returnData;";
        js += "}";
        js = "<script>" + js + "</script>";
        ClientScript.RegisterStartupScript(typeof(string), "", js);
        Button1.Attributes.Add("onclick", "CallWebServices();");
        ScriptManager1.Services.Add(new System.Web.UI.ServiceReference("AutoComplete.asmx"));
 

    [WebMethod]
    public string GetLoginUserCount()
    {
        string UserCount="0";
        UserCount =  Convert.ToString(SqlHelper.ExecuteScalar(ConfigurationSettings.AppSettings["connString"], "GetUsersLoginedCount")).Trim();//已登陆用户总数
        return UserCount;
    }