asp.net 在iframe 中頁面跳轉問題 js

[csharp]  

/// <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.Resp

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *