利用弹出窗口,弹出提示信息。
今天的一个小发现,使用 类似以下的代码,打开一个弹出窗口。
function opencustomerwin()
{
var srcFile = "search_query.aspx?action=customer¶m=&rnd="+Math.random(); //新窗口的文档名称
var winFeatures = "dialogHeight:630px; dialogLeft:150px;dialogWidth=680px;status=no";
var obj = Form1; //将form作为对象传递给新窗口
window.showModalDialog(srcFile, obj, winFeatures);
}
然后在弹出窗口中写如下代码
public void SetFilter(PageBase pagebase,QueryFindParam findParam)
{
//如果用户不存在,则弹出提示信息
if(pagebase.UserInfo==null)
{
System.Web.HttpContext.Current.Response.Write(AspNet.Js.JScode.ShowMessage("登录已经过期"));
System.Web.HttpContext.Current.Response.Write(AspNet.Js.JScode.ClosePage());
return;
}
if(!pagebase.UserInfo.IsSystem)
{
findParam.Filter=pagebase.UserInfo.IsShow;
}
}
则不会打开窗口,只会弹出提示信息。
function opencustomerwin()
{
var srcFile = "search_query.aspx?action=customer¶m=&rnd="+Math.random(); //新窗口的文档名称
var winFeatures = "dialogHeight:630px; dialogLeft:150px;dialogWidth=680px;status=no";
var obj = Form1; //将form作为对象传递给新窗口
window.showModalDialog(srcFile, obj, winFeatures);
}
然后在弹出窗口中写如下代码
public void SetFilter(PageBase pagebase,QueryFindParam findParam)
{
//如果用户不存在,则弹出提示信息
if(pagebase.UserInfo==null)
{
System.Web.HttpContext.Current.Response.Write(AspNet.Js.JScode.ShowMessage("登录已经过期"));
System.Web.HttpContext.Current.Response.Write(AspNet.Js.JScode.ClosePage());
return;
}
if(!pagebase.UserInfo.IsSystem)
{
findParam.Filter=pagebase.UserInfo.IsShow;
}
}
则不会打开窗口,只会弹出提示信息。