WebForm3.aspx.vb
Public Class WebForm3
Inherits System.Web.UI.Page
Protected WithEvents TextBox1 As System.Web.UI.WebControls.TextBox
Protected WithEvents Label1 As System.Web.UI.WebControls.Label
Protected WithEvents Button1 As System.Web.UI.WebControls.Button
Protected MyBody As System.Web.UI.HtmlControls.HtmlControl
#Region " Web 窗体设计器生成的代码 "
'该调用是 Web 窗体设计器所必需的。
Private Sub InitializeComponent()
End Sub
Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
'CODEGEN: 此方法调用是 Web 窗体设计器所必需的
'不要使用代码编辑器修改它。
InitializeComponent()
End Sub
#End Region
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'在此处放置初始化页的用户代码
If IsPostBack Then
Dim strScript As String = "" + vbCrLf
strScript += "window.parent.returnValue='" + TextBox1.Text.Replace("'", "\'") + "'" + vbCrLf
strScript += "window.parent.close()" + vbCrLf
strScript += "" + vbCrLf
If (Not IsClientScriptBlockRegistered("clientScript")) Then
RegisterClientScriptBlock("clientScript", strScript)
End If
End If
If Not IsPostBack Then
MyBody.Attributes.Add("onload", "document.Form1.TextBox1.value=window.parent.dialogArguments")
End If
End Sub
End Class
作者:孟宪会 出自:【孟宪会之精彩世界】
赞
If you have any requirements, please contact webmaster。(如果有什么要求,请联系站长)
QQ:154298438
QQ:417480759