Asp.Net: Masterpages, custom controls and js

Soldato
Joined
5 Mar 2003
Posts
10,771
Location
Nottingham
Ahoy!
Right I have some javascript that is used in pages and in controls that are going to be used in just one site. Before, the javascript was just in the actual page, but as I have added a page that doesn't use the masterpage (but still needs the javascript), I thought I would add the javascript into a js file and just get everything to link to that. Big mistake.

Now, the standalone page finds the javascript ok, but custom controls in pages which use the masterpage dont. As the pages are in subfolders, I assumed it might be something to do with relative paths. I've tried link / run=server / src=~/script/javascriptfile.js, I've tried moving the file into the root and hardcoding the path but nothing works!

Does anyone have any idea? I hate having code repeated all over the shop!
Cheers.
 
ah ha! It was the data bind that I was missing. Thanks for that!

Can you confirm what you meant in the first part? I thought you use a manager on the master page and proxy on the sub pages of the master (and access the manager that way)... if there are any pages which are flying solo - they should have their own script manager?

Not trying to knit pick - just want to make sure I'm not going crazy.
 
Back
Top Bottom