Попробуйте изменить JavaScript на следующий синтаксис:
window.open(url, '_blank', 'menubar=no')
Если это не сработает, попробуйте сначала создать скрипт, например:
Dim sb as New StringBuilder()
Do While r.Read()
sb.AppendLine("window.open('" & r("AttachmentLink") & "', '_blank', 'menubar=no');")
Loop
ClientScript.RegisterStartupScript(Me.GetType(), "popup", sb.ToString(), True)
Одна вещь, которую я тоже заметил, это то, что вы пропустили точку с запятой в коде javascript, иногда это может сильно испортить ситуацию.
Отредактировано для добавления
Отвечая на комментарий, вы можете использовать что-то вроде этого:
sb.AppendLine("window.open('" & LoadPageLink(r("AttachmentLink")) & "' ... )")
Function LoadPageLink(path As String) As String
Return String.Format("loadFile.aspx?p={0}", Server.UrlEncode(path))
End Function
----- LoadFile.aspx
Sub Page_Load(sender as Object, e as EventArgs)
'*
'* OK The worst part here is to detect the content-type of the file
'* because it is being served by a proxy page, instead of directing
'* the browser to the actual file, which would make the IIS gess the
'* content type and send the correct one.
'*
'* Getting the correct content type is beyond the scope of this answer
'*
Dim buffer as Byte(1024)
Using (stream as New FileStream(Request("p")))
Do While True
Dim read = stream.Read(buffer, 0, buffer.Length)
If (read > 0) Then
Response.OutputStream.Write(buffer, 0, read)
Else
Exit Do
End If
End Do
End Using
End Sub