Command Button to Open Window



I have a GridView that contains an command button in one of the columns.
The code-behind does some processing of code and then needs to open a
window.

It looks like the postback fires before the PopUpWindow. Is there anyway
around this?


Private Sub dgJobs_CancelCommand(ByVal source As Object, ByVal e As
System.Web.UI.WebControls.DataGridCommandEventArgs) Handles
dgJobs.CancelCommand

-- code here to do some data manipulation

Dim url As String = "Viewer.aspx?docName=" & JobID

PopUpWindow(Url)

End Sub

Private Sub PopupWindow(ByVal url As String)

Dim script As String = String.Format("<script
language='javascript'>window.open('{0}', '_blank');</script>", url)

RegisterStartupScript("OpenWindow", script)

End Sub



Thanks in advance!

Tina


.


Loading