在弹出界面点击按钮触发后台的postback而不是刷新界面(保留已存在的搜索条件)
function filterData() { var data = { col: $('#filterPopup').attr('name'), val: $('#filterPopupInput').val() }; __doPostBack('filterColumn', JSON.stringify(data)); }
if (IsPostBack) { if (Request.Params["__EVENTTARGET"] != null && Request.Params["__EVENTTARGET"] == "filterColumn") { string data = Request["__EVENTARGUMENT"]; JavaScriptSerializer jss = new JavaScriptSerializer(); var d = jss.Deserialize<dynamic>(data) as Dictionary<string, object>; string filterColumn = d["col"].ToString(); string filgterValue = d["val"].ToString(); } }