• 博客园logo
  • 会员
  • 周边
  • 新闻
  • 博问
  • 闪存
  • 众包
  • 赞助商
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
安安的BLOG
安安目前专注电子商务解决方案^_^
博客园    首页    新随笔    联系   管理    订阅  订阅

目前弹出窗口编辑页勉的最佳解决方案

在父窗口中加上:

 function win_view(id) {
var r = showModalDialog("ClubArticleSortAdd.aspx?id="+id,window,'edge: Raised; center: Yes; help: No;scroll:No; resizable: Yes; status: No;dialogHeight:400px;dialogWidth:500px');
if(r=="ok")
         window.location.href = location.href;
return false;
}


在子窗口中加上的编辑按纽和添加按纽结束的时候
Response.Write("<script language='javascript'>window.returnValue='ok';window.close();</script>");

这个方案中间要添加一个中间的界面:
<%@ Page language="c#" Codebehind="ClubActionSortFrame.aspx.cs" AutoEventWireup="false" Inherits="ReadShop.OtherPageContent.ClubActionSortFrame" %> <%@ Page language="c#" Codebehind="ClubActionSortFrame.aspx.cs" AutoEventWireup="false" Inherits="ReadShop.OtherPageContent.ClubActionSortFrame" %> <%@ Page language="c#" Codebehind="ClubActionSortFrame.aspx.cs" AutoEventWireup="false" Inherits="ReadShop.OtherPageContent.ClubActionSortFrame" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
 <HEAD>
  <title>ClubActionSortFrame</title>
  <meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1">
  <meta name="CODE_LANGUAGE" Content="C#">
  <meta name="vs_defaultClientScript" content="JavaScript">
  <meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
  <LINK href="../Style/Style.css" type="text/css" rel="stylesheet">
  <script language="javascript">
   function ajustHeight()
   {
    var h = document.body.scrollHeight+35
    window.dialogHeight = h+15+"px";     
   }
  </script>
  <base target="_self">
 </HEAD>
 <body MS_POSITIONING="GridLayout">
  <FONT face="宋体"></FONT>
 </body>
</HTML>
<%@ Page language="c#" Codebehind="ClubActionSortFrame.aspx.cs" AutoEventWireup="false" Inherits="ReadShop.OtherPageContent.ClubActionSortFrame" %>
 后台:

  private int id;
  private void Page_Load(object sender, System.EventArgs e)
  {
   InitVariable();
   ShowIframe();
  }

  #region 初始化变量 InitVariable()
  private void InitVariable()
  {
   if(Request.QueryString["id"] != null && Request.QueryString["id"] != "")
   {
    this.id = int.Parse(this.Request.QueryString["id"].ToString().Trim());
   }
   else
   {
    this.id = 0;
   }
  }
  #endregion

  #region 显示IFame ShowIframe()
  private void ShowIframe()
  {
   if(this.Session["URL"] != null)
   {
    Response.Write(@"<iframe name=""topiframe"" src="""+ this.Session["URL"].ToString() + "?id=" + this.id  + @""" frameBorder=""no"" scrolling=""auto"" height=""550"" width=""550"" resizable: Yes;></iframe>");
   }
  }
  #endregion


posted @ 2006-07-07 17:15  安安  阅读(314)  评论(0)    收藏  举报
刷新页面返回顶部
博客园  ©  2004-2026
浙公网安备 33010602011771号 浙ICP备2021040463号-3