Sub ItemCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataListCommandEventArgs)Dim text As String = CType(e.Item.FindControl("LinkButton1"), LinkButton).Text
MsgBox(text)
'Neues Fenster öffnen
Me.Page.Controls.Add(New LiteralControl("<script language=javascript>var newWindow = window.open('../datenbank/ViewDetail.aspx', newWindow, 'width=700,height=500');</script>"))End Sub
Does anyone know how i can access the variable text in the new window?
Can I give in the window.open a variable, which includes my variable "text"?
Or have i to access the control from the new window to get the information from the control?
Can you say me how to access an control from the new window in my old form?
ThnkasYou can pass the variable value as part of a the window open, and then use query string to get the value out.
For example.
Me.Page.Controls.Add(New LiteralControl("<script language=javascript>var newWindow = window.open('../datenbank/ViewDetail.aspx?MyVar=" & text & "', newWindow, 'width=700,height=500');</script>"))
Notice the MyVar added to the URL above.
In the ViewDetail.aspx page's PageLoad Event you would add the following line to get the value ...
Dim MyVar as String = Request.QueryString("MyVar")
Hope this helps,
Glen.
Check this post :view post 818881
regards
0 comments:
Post a Comment