日期:2014-05-18 浏览次数:20443 次
<%@ 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 id="Head1" runat="server"> <title>无标题页</title> <script type="text/javascript" language="javascript"> //用于弹出b页 function ShowDialogArg(url, width, height) { var sFeature = "dialogWidth:" + width + "px;dialogHeight:" + height + "px;resizable:no;scroll:yes;center:yes;help:no"; return window.showModalDialog(url, window, sFeature); } //获取b页回传得数据 function GetGoods() { var goodsName = ShowDialogArg('new0.aspx', 800, 600); if (goodsName != null) { document.getElementById("txt_goodsname").value = goodsName[0]; } } </script> </head> <body> <form id="form1" runat="server"> <div> <asp:textbox id="txt_goodsname" runat="server" ReadOnly="True" Width="217px"/> <input id="Button1" onclick="javascript:GetGoods()" type="button" /> </div> </form> </body> </html>
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="new0.aspx.cs" Inherits="new0" %> <!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 id="Head1" runat="server"> <title>无标题页</title> <script type="text/javascript" language="javascript"> function getValue(aa){ var ss = new Array(); ss[0] = "eeeere"; window.returnValue = aa; //window.returnValue = ss; window.close(); } </script> </head> <body> <form id="form1" runat="server"> <div> <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label> </div> </form> </body> </html>
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Data; using System.Data.SqlClient; using System.Configuration; public partial class new0 : System.Web.UI.Page { static string aa; protected void Page_Load(object sender, EventArgs e) { aa = "rwert"; Label1.Attributes.Add("ondblclick", "getValue('" + aa + "')"); } }