Hi all,

I am using javascript to open a window after a button is pressed. Everything about the window works correctly, I am wondering if anyone knows a way to give the child window the focus that is cross browser compatible. Here is the sub I am using:

VB Code:
  1. 'used for adding a new contact
  2.     Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
  3.         Dim strScript As String
  4.         Dim strFeatures As String
  5.         SupplierInfo.InnerHtml = ""
  6.         ContactInfo.InnerHtml = ""
  7.         LinkButton1.Text = ""
  8.         Linkbutton2.Text = ""
  9.         cmbContact.Items.Clear()
  10.         If cmbSupplier.SelectedIndex = 0 Then
  11.             MessageBox.Show("Please choose a supplier before adding a new contact", _
  12.             "Supplier Needed", MessageBoxButtons.OK, MessageBoxIcon.Error, _
  13.             MessageBoxDefaultButton.Button1, MessageBoxOptions.ServiceNotification)
  14.         Else
  15.             strFeatures = "'left=100,top=50,menubar=no,height=750,width=600,resizable=yes,"
  16.             strFeatures += "scrollbars=no,titlebar=yes,toolbar=no'"
  17.             strScript = "<script language=javascript>"
  18.             strScript += "window.open('Contact.aspx?ContactID=0&SupplierID=" _
  19.             + cmbSupplier.SelectedItem.Value + "','Add New Contact'," & strFeatures & ") "
  20.             strScript += ";window.focus('Add New Contact')</script>"
  21.             Response.Write(strScript)
  22.         End If
  23.     End Sub