62,025
社区成员
发帖
与我相关
我的任务
分享
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="A.aspx.cs" Inherits="多页面传值_A" %>
<!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>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
<asp:Button ID="Button1" runat="server" Text="Button" /></div>
</form>
<script language="javascript">
function DownDvasp(htmlurl)
{
var obj = window.showModalDialog("B.aspx",null,"dialogWidth=200px;dialogHeight=100px");
alert(obj.box1+ obj.box2);
document.getElementById("TextBox1").innerText = obj.box1;
document.getElementById("TextBox2").innerText= obj.box2;
}
</script>
</body>
</html>
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="B.aspx.cs" Inherits="多页面传值_B" %>
<!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">
<!--
function Button1_onclick() {
var obj = new Object();
obj.box1=document.getElementById("TextBox1").value;
obj.box2=document.getElementById("TextBox2").value;
alert(obj.box1+obj.box2);
window.returnValue = obj;
window.opener=null;
window.close();
}
// -->
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
<input id="Button1" type="button" value="button" language="javascript" onclick="return Button1_onclick()" /></div>
</form>
</body>
</html>