Hello mendhak,
I'm confused, This is what I think you meant
If you use
Page.ClientScript.RegisterClientScriptInclude("Java1", ResolveClientUrl("Jscript.js"))
then you don't need to use
<script language="javascript" type="text/javascript" src="JScript.js" ></script> because it redundant. That was my question about redundancy.
I just tried that and it didn't work. I removed the <script language="javascript" type="text/javascript" src="JScript.js" ></script> and in the page load I used
in the button to call the function I usedCode:Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load If Not IsPostBack Then Page.ClientScript.RegisterClientScriptInclude("Java1", ResolveClientUrl("Jscript.js")) 'This does the same thing as ' <script language="javascript" type="text/javascript" src="JScript.js" ></script> Right? End If End Sub
It didn't work. what am I doing wrong? Is the vb code in the wrong place?Code:Dim url As String = "http://www.yahoo.com" ClientScript.RegisterStartupScript(Me.GetType(), "OpenWin", "<script>openNewWin2('" & url & "')</script>")




Reply With Quote