showmodaldialog的问题 VB->C#
0422 2003-10-05 04:34:42 这个是弹出的哪个窗体的饿page_load代码转成c#
谢谢!跟个注释,新手谢谢!!
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'在此处放置初始化页的用户代码
If IsPostBack Then
Dim strScript As String = "<script>" + vbCrLf
strScript += "window.parent.returnValue='" + TextBox1.Text.Replace("'", "\'") + "'" + vbCrLf
strScript += "window.parent.close()" + vbCrLf
strScript += "</script>" + vbCrLf
If (Not IsClientScriptBlockRegistered("clientScript")) Then
RegisterClientScriptBlock("clientScript", strScript)
End If
End If
If Not IsPostBack Then
MyBody.Attributes.Add("onload", "Form1.TextBox1.value=window.dialogArguments")
End If
End Sub