网站制作

本类阅读TOP10

·IIS 安装配置全攻略
·用VS.NET打开网上下载的.NET web项目出错的解决办法
·HTML 4.0 语言快速参考
·限制TextArea区的文字输入数量
·如何在网页上实现进度条
·Apache的配置步骤及测试
·谈谈Jesse James Garrett提到的Ajax
·html基础学习笔记(2)
·页面垂直居中的两种方法
·用asp遍历目录下文件的例子

分类导航
VC语言Delphi
VB语言ASP
PerlJava
Script数据库
其他语言游戏开发
文件格式网站制作
软件工程.NET开发
Javascript中使用对话框,在对话框关闭时刷新前页面的方法

作者:未知 来源:月光软件站 加入时间:2005-2-28 月光软件站

假设在Default.aspx中打开Dialog.aspx,则两个页面的HTML代码如下:
Default.aspx:
<%@ Page language="c#" Codebehind="Dialog.aspx.cs" AutoEventWireup="false" Inherits="MyProject.Dialog" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
 <HEAD>
  <title>WebForm1</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">
 </HEAD>
 <body>
  <FONT face="宋体">
   <form id="Form1" method="post" runat="server">
    <P><a onclick="window.open('Dialog.aspx','NewWindow','left=300,top=200,height=260,width=350,scrollbars=no,resizable=no')" href="#">点我</a></P>
   </form>
  </FONT>
 </body>
</HTML>

Dialog.aspx:
<%@ Page language="c#" Codebehind="Dialog.aspx.cs" AutoEventWireup="false" Inherits="MyProject.Dialog" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
 <HEAD>
  <title>Dialog</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">
  <script language="javascript">
   function RefreshOpener
   {
    opener.window.location.reload();
   }
  </script>
 </HEAD>
 <body onunload="RefreshOpener();">
  <form id="Form1" method="post" runat="server">
   <INPUT type="button" value="Button" onclick="window.close();">
  </form>
 </body>
</HTML>



相关文章

相关软件