1. ModulePath
Useful in – Module Development
Member of – PortalModuleBase Class
Bad Practice:
<asp:image id="img" runat="server" imageurl="/DesktopModules/ModuleName/Images/ImageName.gif"/>
Or
<img src="/DesktopModules/ModuleName/Images/ImageName.gif%E2%80%9D" alt="Alt" />
Good Practice:
<asp:image id="img" runat="server" ImageUrl="<%= ModulePath %>Images/ImageName.gif"/>
Or
<img src="<%= ModulePath %>Images/ImageName.gif" alt="Alt Text"/>
Please note:
a. ModulePath will correctly resolve the path to module image regardless of in whatever the tab you are using.
b. If module name is changed, it will still remain correct.
c. This is also useful when you are linking a javascript file or adding additional css reference.
2. SkinPath
Userfull in – Skin Development
Member of – Skin Class
Similar to ModulePath, SkinPath variable will help you resolve the path to your skin folder. You can use it in similar way as ModulePath.
3. Getting SkinPath in Module Development
Code:
PortalSettings.ActiveTab.SkinSrc will return an full path to your ascx control in skin folder. You can simply use System.IO.Directory.GetParent().Name get folder name.
4. Getting Domain name anywhere in your development cycle
Code:
DotNetNuke.Commons.Globals.GetDomainName(Request);
There many in the list, but that's it for now. Happy coding:)
Subscribe to:
Post Comments (Atom)
Popular Posts
-
Hi all, Creating a modal popup for asp.net users is always easy, its simply a modal panel, modal popup extender of asp.net ajax and all is ...
-
// using DotNetNuke.Entities.Portals; // using System.Collections; PortalAliasController paController = new PortalAliasController(); PortalA...
-
I was configuring one of our clients farm which required FBA on different web applications (around 5) and he wanted each web application sho...
Thanks for the sharing.
ReplyDeleteSmall typo at the end I believe:
DotNetNuke.Commons.Globals.GetDomainName(Reqest);
should be:
DotNetNuke.Commons.Globals.GetDomainName(Request);
Added the u in Request
thanks, corrected the type
ReplyDeleteModulePath in an edit control doesn't work; what do you use in that ascx?
ReplyDelete