Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0CanCan't figure out relative path to work.
Previous
 
Next
New Post
8/8/2007 5:15 PM
 

I need to include a javascript file and a css file on my module's page. Putting it there like this:

<script type="text/javascript" language="javascript" src="/js/TabbedItems/tabs2.js"></script>
<link rel="Stylesheet" href='/js/TabbedItems/tabs.css' />

creates a problem with child portals or development (i.e. http://localhost/Website - the above will resolve to http://localhost/js... which is incorrect).

Now, I've tried all sorts of ways to make sure that this path gets resolved correctly, but... 50/50 didn't work, I am off to audience (and I don't have any friends :( - so you, guys, are my only hope).

Ok, seriously, though, it's a pain and I need your help.


Vitaly Kozadayev
Principal
Viva Portals, L.L.C.
 
New Post
8/9/2007 9:16 AM
 

Hi Vitkoz,

  Did you find a solution for this problem. I am having similar situation where I couldn't have my javascript running when i deploy my module.

 

<

 

script src="<%=Page.ResolveUrl("js/prototype.js") %>" type="text/javascript"></script

>

 

 

 

I have a simple alert statement on this js file.

 

I appreciate any help.

 
New Post
8/9/2007 10:03 AM
 

Hi Vitkoz,

     I had the same probelm... My js script worked fine if I plug in my ascx control to a standalone aspx page but didn't work when i deploy the module to dnn framework.

I found a dirty way of fixing it. If you move your js files to root js folder instead of your module level , will fix the issue. This is because after module deployment its the default aspx page which executes the relative path and obviously it can't find your js file on the specified root js folder!

Hope this helps you.

-Mals

 

 
New Post
8/10/2007 1:36 AM
 

My problem is actually a little different. I want to reference files in folders in root directory, but I don't want to constantly change this path depending on which environment I am in - development or production, or child portal vs. parent.


Vitaly Kozadayev
Principal
Viva Portals, L.L.C.
 
New Post
8/10/2007 2:36 PM
 

vitkoz wrote

My problem is actually a little different. I want to reference files in folders in root directory, but I don't want to constantly change this path depending on which environment I am in - development or production, or child portal vs. parent.

To reference the root you should be able to use /YourPath/here.jx


-Mitchel Sellers
Microsoft MVP, ASPInsider, DNN MVP
CEO/Director of Development - IowaComputerGurus Inc.
LinkedIn Profile

Visit mitchelsellers.com for my mostly DNN Blog and support forum.

Visit IowaComputerGurus.com for free DNN Modules, DNN Performance Tips, DNN Consulting Quotes, and DNN Technical Support Services
 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0CanCan't figure out relative path to work.


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out