ascx and JScript

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
 
H

Hans Kesting

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
 
B

Bruce Barker

try

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


-- bruce (sqlwork.com)
 

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,770
Messages
2,569,583
Members
45,073
Latest member
DarinCeden

Latest Threads

Top