jquery-ajax(post)调用c#后台 .
来源:互联网 发布:不属于网络群众路线 编辑:程序博客网 时间:2024/05/01 14:10
1) jquery代码:
$.ajax({
type: "POST", //访问WebService使用Post方式请求
contentType: "application/json",
url: "UserManager.aspx/EditGroup",
data: "{strWebName:'" + strWebName + "',strGroupName:'" + strGroupName + "',strNewUserList:'" + strNewUserList + "'}",
dataType: 'json',
success: function(result) {//回调函数,result,返回值
if (result.d == true) {
alert("设置成功!");
diag.close();
window.location.href = window.location.href;
}
else {
alert("设置失败!");
diag.close();
}
}
});
2) 后台代码:
/// <summary>
/// 修改组员
/// </summary>
/// <returns></returns>
[WebMethod]
public static bool EditGroup(string strWebName,string strGroupName,string strNewUserList)
{
bool flag = false;
try
{
SPSecurity.RunWithElevatedPrivileges(
delegate()
{
Role item = dc.Role.SingleOrDefault(u => u.WebName == strWebName && u.GroupName == strGroupName);
if (item != null)
{
item.Users = strNewUserList;
dc.SubmitChanges();
flag = true;
}
else
{
flag = false;
}
});
}
catch (Exception ex)
{
flag = false;
}
return flag;
}
- jquery-ajax(post)调用c#后台
- jquery-ajax(post)调用c#后台 .
- jquery-ajax(get)调用c#后台
- jquery-ajax(get)调用c#后台
- jquery 使用ajax调用c#后台方法
- C#后台调用jquery
- jquery ajax调用后台方法
- jQuery Ajax 调用后台方法
- jQuery $.post提交与C#后台交互
- jquery ajax调用asp.net 后台方法
- JQuery Ajax调用asp.net后台方法
- jQuery.ajax()调用asp.net后台方法
- JQuery的$.ajax()调用后台方法
- Jquery Ajax调用后台页面方法
- JQuery Ajax调用asp.net后台方法
- JQuery Ajax调用asp.net后台方法
- JQuery Ajax调用asp.net后台方法
- jQuery AJAX实现调用页面后台方法
- JQuery iframe页面操作父页面中的元素与方法 .
- RSA算法
- javascript OOP
- jquery-ajax(get)调用c#后台
- 字符数字中空字符的总结
- jquery-ajax(post)调用c#后台 .
- IIS7中更改.net framework版本
- 产品可靠性
- winform 关闭窗体 释放内存
- poj1002
- jquery实现两个dropdownlist无刷新联动 .
- javascript 获取键盘、鼠标ascii码 .
- javascript(c#) 使用escape、unescape .
- Ubuntu USB Android Drivers