• jquery 使用ajax调用c#后台方法


         $.ajax({
                            type: "get",
                            cache: false,
                            //方法所在页面和方法名     
                            url: "ShareCus.aspx",
                            data: { "name": para,"xml":"1" },
                            contentType: "application/json; charset=utf-8",
                            dataType: "text",
                            success: function (data) {
                                $('#<%=lb_dutyname.ClientID%>').text(data);
                            },
                            error: function (err) {
                                alert(err);
                            }
                        });

    .cs

     protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (Request["xml"]==null)
                {
                }
                else
                {
                    GetTip(Request["name"]??string.Empty);
               
                }

            }

        }

     public   void GetTip(string name)
        {
            string result = string.Empty;
            Users user = null;
            if (!string.IsNullOrEmpty(name))
            {

     result=name+"1111";
             }
            Response.Clear();
            Response.Write(result);
            Response.End();
        }

  • 相关阅读:
    DYCom多平台聊天室Sample
    silverlight多人在线游戏示例
    设计模式之: 命令模式
    Vector
    flashBuilder加入AsDoc注释
    转:每个Flash开发者应该知道的事情
    flashBuilder无法调试:57%就不动了
    UML类图实例
    Dictionary
    Enterprise Architect使用(一)
  • 原文地址:https://www.cnblogs.com/keanuyaoo/p/3292279.html
Copyright © 2020-2023  润新知