非常简单的内容,两个页面,例子如下:
- < %@ Page Language ="C#" AutoEventWireup ="true" CodeFile ="Default3.aspx.cs" Inherits ="Default3" %>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- < html xmlns ="http://www.w3.org/1999/xhtml" >
- < head runat ="server" >
- < title > Untitled Page</ title >
- < script language ="javascript" type ="text/javascript" >
- // <!CDATA[
- function btnTest_onclick() {
- var val = window .showModalDialog("Default4.aspx","","Status:No;DialogWidth:450px;DialogHeight:350px;help:no");
- if(val != null)
- {
- var array = val .split(";");
- for(i =0 ;i< array.length ;i++)
- {
- alert(array[i]);
- }
- }
- }
- // ]]>
- </ script >
- </ head >
- < body >
- < form id ="form1" runat ="server" >
- < div >
- < input id ="btnTest" type ="button" value ="Test" onclick ="return btnTest_onclick()" /> </ div >
- </ form >
- </ body >
- </ html >
- < %@ Page Language ="C#" AutoEventWireup ="true" CodeFile ="Default4.aspx.cs" Inherits ="Default4" %>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- < html xmlns ="http://www.w3.org/1999/xhtml" >
- < head runat ="server" >
- < title > Untitled Page</ title >
- < script language ="javascript" type ="text/javascript" >
- // <!CDATA[
- function btnClose_onclick() {
- returnValue = "0001;hubery;Beijing" ;
- window.close();
- }
- // ]]>
- </ script >
- </ head >
- < body >
- < form id ="form1" runat ="server" >
- < div >
- < input id ="btnClose" type ="button" value ="close" onclick ="return btnClose_onclick()" />
- </ div >
- </ form >
- </ body >
- </ html >