asp.Net iframeで情報をポップアップし、ジャンプ問題の検討を実行

1384 ワード

 
  
///
/// iframe ,
///

///
///
public static void ResponseShowMsg(string msg, string targetPageName)
{
string str = " alert('{0}'); window.parent.frames[\"sysMain\"].location.href = '{1}'; ";
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, " !");
}
}