1、倒退://history.go(-1);//javascript: history.back();
两种页面跳转的方法:
//Response.Write("<script>alert('false');window.location.href='QuestionList.aspx';</script>");
Page.ClientScript.RegisterStartupScript(GetType(), "js", "<script>alert('操作有误');window.location.href='QuestionList.aspx';</script>");
2、删除时的确认弹框,调用时:OnClientClick="return BoolDelete();//注:别忘了return(需要返回值)
3、时间查询:
if (!string.IsNullOrEmpty(BeginDate)) { where = where + " and BeginDate>='" + BeginDate + "'"; } if (!string.IsNullOrEmpty(EndDate)) { where = where + " and EndDate<='" + EndDate + "'"; }
4、前端输入框的非空判断(失去焦点即显示提示)、点击新增自动获取为空输入框的焦点。
事件调用方法:
onblur="tip(7,checktdatetimeEnd);"
后台设置:
if (!IsPostBack) { DDBind(); Session["First"] = "true"; // Response.Write(""); } else { Session["First"] = "false"; //Response.Write(""); }