pop up window using javascript in response.write
-
Can someone please have a look at this and explain to me why the following happens? 1) when i click on say welding.doc it doesn't popup and my popup blocker in firefox is turned off. 2) the item is in my inetpub root dir as welding.doc so I don't see why it doesn't load when i type http://localhost/welding.doc it shows just fine. here is my code Protected Sub ddnNotes_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles ddnNotes.SelectedIndexChanged 'Response.Write("var win=window.open('" & ddnNotes.SelectedValue & "',null,'width=510,height=255,top=250,left=250','true');") End Sub thanks for the help. MeterMan "Live life to its fullest because, you never know when it will be taken away."
-
Can someone please have a look at this and explain to me why the following happens? 1) when i click on say welding.doc it doesn't popup and my popup blocker in firefox is turned off. 2) the item is in my inetpub root dir as welding.doc so I don't see why it doesn't load when i type http://localhost/welding.doc it shows just fine. here is my code Protected Sub ddnNotes_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles ddnNotes.SelectedIndexChanged 'Response.Write("var win=window.open('" & ddnNotes.SelectedValue & "',null,'width=510,height=255,top=250,left=250','true');") End Sub thanks for the help. MeterMan "Live life to its fullest because, you never know when it will be taken away."
I am not sure about it is working or not. but you can try to use a following code, may be it's working. Response.Write("var win=window.open('/" & ddnNotes.SelectedValue & "',null,'width=510,height=255,top=250,left=250','true');") Chetan Visodiya
-
Can someone please have a look at this and explain to me why the following happens? 1) when i click on say welding.doc it doesn't popup and my popup blocker in firefox is turned off. 2) the item is in my inetpub root dir as welding.doc so I don't see why it doesn't load when i type http://localhost/welding.doc it shows just fine. here is my code Protected Sub ddnNotes_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles ddnNotes.SelectedIndexChanged 'Response.Write("var win=window.open('" & ddnNotes.SelectedValue & "',null,'width=510,height=255,top=250,left=250','true');") End Sub thanks for the help. MeterMan "Live life to its fullest because, you never know when it will be taken away."
I would double check the rendered html markup by doing a view source, make sure the link is correct. Also, the Page class (or the ClientScriptManager in the ASP.NET 2) provides a set of utility methods to emit the script at the server side that you want to use instead of the Response.Write method.