473,403 Members | 2,284 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

asp solution not finding .js file...??

Hi Guys,

I have a asp.net app which utilises data from a SQL Server 2000 database - with java controlling a lot of the drop-downs etc and visual basic controlling the calling of stored procs. etc.

When I compile the project though - none of the java controls on the page work.. it just won't recongise the .js file.

On the 'start page' - I try to get the page to refer to a java file as follows:

<script language="javascript" type="text/javascript" src="scripts.js"></script>

I have even tried it by puttin the relative adress before the scripts.js - also I have tried putting the script directly into the asp page - but to no avail. Anyone know why this would be?

Cheers.
Andy.
Feb 4 '08 #1
6 1315
radcaesar
759 Expert 512MB
Whats your version of .NET ?

if(!Page.IsClientScriptBlockRegistered("MyScript") )
{

Page.RegisterClientScriptBlock("MyScript","<SCRIPT Language='JavaScript' src='MyJavaScriptFile.js'></SCRIPT>");

}
Feb 4 '08 #2
kenobewan
4,871 Expert 4TB
You need to refer to this as JavaScript to avoid confusion. Looks like a simple referencing problem. Is scripts.js in the same directory?
Feb 4 '08 #3
thanks for your reply..

I am using VS.net 2003. I put your code into my test environment - and got some build errors: C:\Inetpub\wwwroot\Freightlink2\WebForm1.aspx(84): Could not find any attribute 'onkeydown' of element 'TextBox'.
etc. etc. for each drop-down control..

I think the app is reading the .js code as I had it originally because I can put dummy text in the default value of the drop-down box i.e. document.Form1.lstDepartingTrainNumber0[0]= new Option('testing testinig', '');

However, there are no values populating the drop-downs... this is a strange one....
Feb 5 '08 #4
You need to refer to this as JavaScript to avoid confusion. Looks like a simple referencing problem. Is scripts.js in the same directory?
hi there.. yep - the file 'scripts.js' is in the same directory. I tried moving it into a sub-directory just so I could reference it to see if that helps i.e. C:\Inetpub\wwwroot\Freightlink2\scripts\scripts.js " but and it appears that the java is being found because I can edit the display value on the drop-down boxes and it is reflected on the form - however none of the java functions are working because the contents of the drop-down boxes are empty....
Feb 5 '08 #5
hi there.. yep - the file 'scripts.js' is in the same directory. I tried moving it into a sub-directory just so I could reference it to see if that helps i.e. C:\Inetpub\wwwroot\Freightlink2\scripts\scripts.js " but and it appears that the java is being found because I can edit the display value on the drop-down boxes and it is reflected on the form - however none of the java functions are working because the contents of the drop-down boxes are empty....
If your application has no problem to find the .js file, the problem might be from calling the functions in .js. How do you calling the functions in .js? Well the dropdown list will not be populated automatically unless you call functions in clients to fill the dropdown list. You can register client attributes such as "onclick" to a control. See the article for details
Feb 5 '08 #6
I have sorted it out - the problem was that one of the web forms that I was bringing into the project was referring to an old .dll file. As soon as I set that straight and rebuilt the project everything started working.

Cheers for the advice,

Andy.
Feb 13 '08 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

117
by: Peter Olcott | last post by:
www.halting-problem.com
1
by: Simon Harris | last post by:
Hi All, I work in a team of three developers. 99% of our work is developing 'applications' for our organisations Intranet - mainly whats become known to us as e-employee apps, such as...
5
by: Nick Gilbert | last post by:
Hi, I'm not sure if I've broken my VS.NET installation or if there has always been a bug of some sort, but basically Find in Entire Solution (ctrl-shift-F) isn't finding strings in my solution's...
4
by: Joe | last post by:
I'm hosting my web service on a Windows 2003 box which is remotely located. When trying to add a web reference to a C# project I get an error message 'There was an error downloading...
18
by: JohnR | last post by:
From reading the documentation, this should be a relatively easy thing. I have an arraylist of custom class instances which I want to search with an"indexof" where I'm passing an instance if the...
4
by: mrmagoo | last post by:
I'm creating a VB.Net project. It's a small utility. However, my boss wants me to put it in with a larger solution that the department uses, so that a suite of tools are all in one place. That's...
0
by: NSF12345 | last post by:
Iv developed a small program that looks for a file over our network, and copy it to the location of another computer. Im using the "If FileExists("\\oldpc\main share\Folder\file.txt") Then" way of...
1
by: Empyrean | last post by:
I'm attempting to make my first program that involves file input, but I'm running into problems finding the .txt file. I placed the file inside the same folder as the rest of the project, but it...
4
by: Poldie | last post by:
I'm using Visual Studio 2005 SP1 on a Win2K SP4 system. VS is set up to use "web development settings ". I use VB. If I create a new web application project, then close the project and exit VS...
1
by: Alex | last post by:
Hi, I'm still rather green with Visual Basic, but I'm about to start maintaining code written by another developer. As I open the Solution it gives the following warning: "The referenced...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.