ascx and JScript

  • Thread starter Thread starter Gary Coutts
  • Start date Start date
G

Gary Coutts

Hi,

Is there anyway of connecting a java script to a User Control ascx.


I define this in the file

<script language=javascript src="Javascript/ShopFront.js" >

but it never runs.


The script has been tested stand alone using an Active Server Page aspx and
it works fine

Any ideas?


I am using VS .NET 2003.



Cheers

gwc
 
Hi,
Is there anyway of connecting a java script to a User Control ascx.


I define this in the file

<script language=javascript src="Javascript/ShopFront.js" >

but it never runs.


The script has been tested stand alone using an Active Server Page aspx and
it works fine

Any ideas?


I am using VS .NET 2003.



Cheers

gwc

that "src" attribute is interpreted by the browser. That relative path
will count from the current position of the *asPx* (the browser knows
nothing about any ascx). Could this be the problem?

Do you get any error messages on the browser? (try FireFox maybe)

Hans Kesting
 
try

RegisterClientScriptBlock("mycontrolinit","<script language=javascript
src=\"Javascript/ShopFront.js\" >")


-- bruce (sqlwork.com)
 
Back
Top