asp.net在iframe中弹出信息并执行跳转问题探讨

(编辑:jimmy 日期: 2024/10/6 浏览:2)

复制代码 代码如下:
/// <summary>
/// iframe 中,弹出信息并跳转
/// </summary>
/// <param name="msg"></param>
/// <param name="targetPageName"></param>
public static void ResponseShowMsg(string msg, string targetPageName)
{
string str = "<script> alert('{0}'); window.parent.frames[\"sysMain\"].location.href = '{1}'; </script>";
string Urls = HttpContext.Current.Request.Url.OriginalString;
if (Urls.LastIndexOf('?') > 0)
{
Urls = Urls.Substring(0, Urls.LastIndexOf('?')).Replace(HttpContext.Current.Request.Url.Segments[HttpContext.Current.Request.Url.Segments.Length - 1], targetPageName);
}
else
{
Urls = Urls.Replace(HttpContext.Current.Request.Url.Segments[HttpContext.Current.Request.Url.Segments.Length - 1], targetPageName);
}
str = string.Format(str, msg, Urls);
HttpContext.Current.Response.Write(str);
}

页面调用 cs文件
复制代码 代码如下:
protected void btnSave_Click(object sender, EventArgs e)
{
if (bll.RoleAdd(model, tempMs))
{
CmvspCommon.MessageBox.ResponseShowMsg( "保存成功!", "add.aspx");
}
else {
CmvspCommon.MessageBox.Show(this, "保存失败!");
}
}
一句话新闻
Windows上运行安卓你用过了吗
在去年的5月23日,借助Intel Bridge Technology以及Intel Celadon两项技术的驱动,Intel为PC用户带来了Android On Windows(AOW)平台,并携手国内软件公司腾讯共同推出了腾讯应用宝电脑版,将Windows与安卓两大生态进行了融合,PC的使用体验随即被带入到了一个全新的阶段。