Small width layout Medium width layout Maximum width layout Small text Medium text Large text
     Search
Downloads Downloads Directory Directory Forums Forums Forge Forge Blogs Blogs        Marketplace Marketplace Careers Program Careers
Community › Forums Register  |  

DotNetNuke Marketplace
  Need Help?  
Professional technical support for DotNetNuke is available from DotNetNuke Corporation.
 


  Ads  
The best choice for your web site host, email hosting, and domain registration.
 


  Sponsors  

Meet Our Sponsors

FCKeditor Project
Salaro -- Skins and more
OnyakTech
The best choice for your web site host, email hosting, and domain registration.
CrystalTech Web Hosting™
Webhost4life, specialists in DNN hosting
 


DotNetNuke Forums
 
  Forum  General DotNetN...  Extend It! ( Pr...  include js file from module?
Previous Previous
 
Next Next
New Post 2/21/2008 7:28 AM
Unresolved
User is offline onishiro
140 posts
9th Ranked


include js file from module? 
Modified By onishiro  on 2/21/2008 11:36:20 AM)

I have a module and I need to include a js file.

I'm using the following code, but it can't find it:

[code]**filtered** type="text/javascript" language="javascript" src="~/js/helper.js">[/code]

How can I include the file which is in the dotnetnuke js/ directory?

Thanks

 

 

 
New Post 2/21/2008 7:33 AM
User is offline MH
14 posts
10th Ranked


Re: include js file from module? 

Here is the code I use within the codebehind. (C#)

                modPath = this.ModulePath;
                if (!Page.ClientScript.IsClientScriptIncludeRegistered("calendarDateInput"))
                    Page.ClientScript.RegisterClientScriptInclude("calendarDateInput", modPath + "calendarDateInput.js");

Note that this loads a JS that is in the same directory as the module (modPath) and puts it in the same place that DNN does (Not in the head, but at the top of the form). In addition, if you have more than one instance of said module on a page, this will ensure that the Javascript get's loaded only once.

 
New Post 2/21/2008 9:30 PM
User is offline Agung Riyadi
100 posts
9th Ranked


Re: include js file from module? 

Maybe this link will help you : http://blogs.snapsis.com/PermaLink,guid,eef98c82-f54d-480b-8e36-309ca6e406d8.aspx

I used it since one year ago.

HTH.

 
Previous Previous
 
Next Next
  Forum  General DotNetN...  Extend It! ( Pr...  include js file from module?
 


Forum Policy

These Discussion Forums are dedicated to the discussion of the DotNetNuke Web Application Framework.

For the benefit of the community and to protect the integrity of the project, 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 DotNetNuke.
2. Discussion or promotion of DotNetNuke product releases under a different brand name are strictly prohibited.
3. No Flaming or Trolling.
4. No Profanity, Racism, or Prejudice.
5. Site Moderators have the final word on approving/removing a thread or post or comment.
6. English language posting only, please.

 


Subzero Solutions
Dutch / English DotNetNuke consultancy services. Custom module development in any version. Complete application integration. Small business portal hosting. Your ideas our innovation - Your success our motivation. K.v.k Amsterdam: 34236342
www.subzero-solutions.net
Hosting for DotNetNuke
SiteGround.com is the best place to host your DotNetNuke website! Expert DotNetNuke support, reliable servers, low price!
www.SiteGround.com
Code Endeavors, LLC
Do you Endeavor to Enhance your DotNetNuke designs by utilizing AJAX technologies to more efficient interactive web experiences
www.codeendeavors.com

DotNetNuke Corporation   Terms Of Use  Privacy Statement
DotNetNuke®, DNN®, and the DotNetNuke logo are trademarks of DotNetNuke Corporation
Hosted by MaximumASP