Open New Window and ASP .NET Style Question

J

jm

I wanted to do something simple. I wanted to open a new window with a
button. Went around the world on Google and found:



Dim endStr As String = "</"
Dim strJScript As String

strJScript = "<script language=""JavaScript"">"
strJScript += "<!-- " + vbCrLf
strJScript += "window.open
(""AddRowCall.aspx"",""myWindow"",""top=0,left=0,width=790,height=500,buttons=no,scrollbars=yes,location=no,menubar=no,resizable=no,status=no,directories=no,toolbar=no"");"
+ vbCrLf
strJScript += "// -->"
strJScript += endStr + "script>"

Page.RegisterClientScriptBlock("clientScript", strJScript)


Is this the way I am supposed to do this? Is there something wrong
with just creating a regular old html button (I had wanted the
asp:button, but see no benefit) and some javascript in the page? Not
to mention, this doesn't work; it just never fires. Thanks.
 
R

Rikh

Do not mix the scripts, You have specified Javascript as
the script language, and you asre also using VB constant
vbcrlf. if you mix the scripts the function will not work.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,135
Latest member
VeronaShap
Top