Got a few questions:
1. Are you try to reference to a javascript file from the webform or
the web user control?
2. Could you give more details in how you layout your webform and web
user control? For example, where are the webform, web user control,
and the javascript file located?
It's most likely that you have the script placed in the wrong
location. When you load a user control to a webform, the user control
is running under the location of the webform, so the javascript's
relative path is based on the webform's location.
For example,
(Folder1)
WebForm
(Folder2)
Web user control
The relative path for the javascript will be
/Folder1/Scripts
not
/Folder1/Folder2/Scripts
Tommy,
"New User" <an*******@discussions.microsoft.com> wrote in message news:<11****************************@phx.gbl>...
I have a System.Web.UI.UserControl as custom control and
I have a javascript block for user control. The problem
is I want to bring src attribute from outside as property
or other method.
e.g <script language="JavaScript"
src="Scripts/filename.js"></script>
When I register this control (drop control) on aspx page
different than current folder in other words, when I have
aspx page few level down from root asp.net application
the src attribute does not work. Any ideas.... I am
really new to asp.net