Quantcast
Channel: Visual Studio and Visual Web Developer Express
Viewing all articles
Browse latest Browse all 3509

Javascript window.open from codebehind not opening

$
0
0

Hi,

I'm passing an SQL Server record id to a Javascript function to open a popup window with details.  I receive no errors, but no popup appears.  I suspect I am not concatenating something correctly in the javascript variable 'loc'.  The record id is passed correctly to the function.

Here is my codebehind call:

Protected Sub GridView1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles GridView1.SelectedIndexChanged
   Dim recID As String = GridView1.Rows(GridView1.SelectedIndex).Cells(9).Text.ToString
   Page.ClientScript.RegisterClientScriptBlock([GetType](), "script", "openDetails('" & recID & "');", True)
End Sub

Here is my javascript function:

function openDetails(recID)
   {
        var loc = "'Details.aspx?field1=" + recID +"'";
        window.open(loc, '_blank', 'width=500,height=500,toolbar=no,resizable=no,location=center,status=no', false);
   }

Any help is greatly appreciated,

Marc Miller


Viewing all articles
Browse latest Browse all 3509

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>