Thanks!
I got everything to work using RegisterClientScriptInclude but the only way I could get it to work was calling RegisterStartupScript again when I wanted to call the function. It works great but I wanted to make sure I was doing it correctly or if there was a better way to call my function without using RegisterStartupScript. Is there a better way to do this than the way I'm dooing it?
Thanks
GEM
Javascript code:
Code://// Jscript.js ///// function openNewWin2(url) { var x = new Object; x = window.open(url, 'mynewwin', 'width=600,height=600,toolbar=1'); }HTML Code:<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default2.aspx.vb" Inherits="Default2" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <script language="javascript" type="text/javascript" src="JScript.js" ></script> <head runat="server"> <title></title> </head> <body> <form id="form1" runat="server"> <div> <asp:Button ID="btnOpenPop" runat="server" Text="Open Pop" /> </div> </form> </body> </html>Code: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")) End If End Sub Protected Sub btnOpenPop_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnOpenPop.Click Dim url As String = "http://www.yahoo.com" ClientScript.RegisterStartupScript(Me.GetType(), "OpenWin", "<script>openNewWin2('" & url & "')</script>") '\\is there a better way to call my function than using RegisterStartupScript - this seem rendundant End Sub




Reply With Quote