Javascript problem in Custom Webcontrol

N

New User

I have following structure for my project


myproj
Controls/control1
morepages/special.aspx
specialpages/webpage1.aspx
scripts/filename.js
default.aspx



I have a control1 which has a public property name
ScriptFilePath for bring in external javascript file.

E.g it works for when I use control in default.aspx using
ScriptFilePath="Scripts/filename.js"
ok when i click on link to navigate it goes to for
example, morepages/special.aspx page.

However,

When I use same control in webpage1.aspx with
ScriptFilePath="../Scripts/filename.js" then
I click on link in webpage1.aspx it produces following
path myproj/specialpages/morepages/special.aspx rather
than morepages/special.aspx.


any ideas


Thanks in advance
 
I

Imtiaz Hussain

You can also use ../ to go up one level and then traverse to the
appropriate directory where the javascript file resides.

Hope this helps.

Imtiaz Hussain.

This posting is provided "as is" with no warranties and confers no rights.
 

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,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top