日期:2014-05-18 浏览次数:20435 次
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="PopKeywords.aspx.cs" Inherits="WebUI.BusinessCenter.PopKeywords" %> <!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> <link href="../css/css.css" rel="stylesheet" type="text/css" /> <base target="_self" /> </head> <body> <form id="form1" runat="server"> <table border="0" cellpadding="0" cellspacing="0" align="center"> <tr> <td height="40" align="center"> <asp:TextBox ID="txbChild" runat="server" Width="400px"></asp:TextBox> </td> </tr> </table> </form> </body> </html> <script type="text/javascript" language="javascript"> <!-- var k = window.dialogArguments; //获得父窗口传递来的值 if (k != null) { document.getElementById("txbChild").value = k.document.getElementById("txbFather").value; } //--> </script>
using System; using System.Data; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; namespace WebUI.BusinessCenter { public partial class PopKeywords : System.Web.UI.Page protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { string getFatherValue = this.txbChild_getFather.Text.ToString().Trim(); //实际上,getFatherValue 取得值是空的 } } }
<script type="text/javascript" language="javascript"> <!-- var k = window.dialogArguments; //获得父窗口传递来的值 if (k != null) { document.getElementById("txbChild").value = k.document.getElementById("txbFather").value; } //--> </script>
<%@ Page Language="C#" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <script runat="server"> </script> <html xmlns="http://www.w3.org/1999/xhtml"> <head run