Support Forums

 
  iFinity Support Forum  General  Beginners Forum  Problem with Custom Modules and AJAX
Previous Previous
 
Next Next
New Post 7/9/2008 12:00 AM
  leom
5 posts
No Ranking


Problem with Custom Modules and AJAX 

I have a custom module that I am developing using AJAX and at the top of the module I have a reference to a javascript file that is in my modules folder:

<asp:ScriptManagerProxy ID="smp" runat="server">
    <Scripts>
        <asp:ScriptReference Path="~/DesktopModules/mymodule/module.js" />
    </Scripts>
</asp:ScriptManagerProxy>

The problem comes in that somewhere along the line in rendering the page, the path to the js file is rendered as http://www.mysite.com/home/desktopmodules//mymodules/module.js not the correct url of http://www.mysite.com/desktopmodules//mymodules/module.js. (verified this using Firebug to show the missing file)

This also seems to happen in module development anywhere that I use the "~/" syntax of .NET to reference the file starting at the root. (images, etc)

Haven't been using DNN that long and iFinity an even shorter time but doing .NET and VB for what seems like forever.

Thanks

leo

 

 

 

 
New Post 7/9/2008 12:55 PM
  Bruce Chapman
572 posts
1st Level Poster


Re: Problem with Custom Modules and AJAX 

Leo

Which product are you using?

-Bruce

 
New Post 7/18/2008 5:31 AM
  leom
5 posts
No Ranking


Re: Problem with Custom Modules and AJAX 

URLMaster.

 
New Post 7/18/2008 10:46 AM
  Bruce Chapman
107 posts
1st Level Poster


Re: Problem with Custom Modules and AJAX 

When you set your file reference, it helps to use a 'ResolveUrl' call on the server side to make sure the script location is set correctly.   This may mean using a server-side control instead of a simple js reference, but it will make your module more flexible for different installations.  Your other choice is to hardcode the reference without the ~/.  You can just use the /DesktopModules/etcetc  reference - because your module path is set during the .dnn file install process, you know what it's going to be at all times.


Chief Software Hacker
 
Previous Previous
 
Next Next
  iFinity Support Forum  General  Beginners Forum  Problem with Custom Modules and AJAX
Can't find the answer?
 

If you can't find the answer and don't have time...try out the Premium Support service.  Get personal attention and get the problem fixed by an expert.

 

Support Guidelines.. Please read before posting

To get support on iFinity products and services, please search the forums for the the answer to the problem you are seeking. If you cannot find a solution, post a question in the relevant forum.   Ensure that you specify the relevant versions of the problem, and the actual error message or a detailed description of the problem.    You will need to register with this site to post on the forum.  If you have a Microsoft Live (Hotmail/Passport) account you can use that.  If you have a Open Id account you can use that.  If you neither of these, you will need to register a user Id and password.

If you wish, you can use the Premium Support Service for one-on-one support.