16,554
社区成员
发帖
与我相关
我的任务
分享
<%@ Master Language="VB" AutoEventWireup="false" CodeBehind="Site1.master.vb" Inherits="WebApplication2.Site1" %>
<!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></title>
<asp:ContentPlaceHolder ID="head" runat="server">
</asp:ContentPlaceHolder>
</head>
<body>
<form id="form1" runat="server">
<div>母版页
<asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
</asp:ContentPlaceHolder>
</div>
</form>
</body>
</html>
<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site1.Master" CodeBehind="a.aspx.vb" Inherits="WebApplication2.a" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<asp:TextBox ID="TextBox1" runat="server" AutoPostBack="True"></asp:TextBox>
</asp:Content>
<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="b.aspx.vb" Inherits="WebApplication2.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></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Label ID="Label1" runat="server" Text="9999"></asp:Label>
<asp:Button ID="Button1" runat="server" Text="传递参数" />
</div>
</form>
</body>
</html>
Public Class a
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
End Sub
Protected Sub TextBox1_TextChanged(ByVal sender As Object, ByVal e As EventArgs) Handles TextBox1.TextChanged
If TextBox1.Text = "0" Then Response.Write(" <script> window.open( 'b.aspx','参数窗口', 'height=200, width=400, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no'); </script> ")
End Sub
End Class
Public Class b
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
End Sub
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button1.Click
Dim scriptstr As String
scriptstr = " <script> window.opener.document.getElementById('textbox1').value= '" & Label1.Text & " '; " & " </script> "
Page.ClientScript.RegisterStartupScript(Me.GetType(), "return ", scriptstr)
Page.ClientScript.RegisterStartupScript(Me.GetType(), "close ", " <script> top.opener=null;top.close(); </script> ")
End Sub
End Class