Using the DotNetNuke Profile Photo in a Custom Module

Posted by & filed under Development, DotNetNuke.

private string GetUserPhotoUrl(UserInfo user) { if (user.Profile.Photo == null || user.Profile.Photo == "-1") return user.Profile.PhotoURL; else return VirtualPathUtility.ToAbsolute("~/LinkClick.aspx") + "?fileticket=" + user.Profile.Photo; } An anonymous user or a user without a profile photo will always get the default no_avatar.gif image.

DotNetNuke MVP Module Development: Tip #2 Disable AutoDataBind

Posted by & filed under Development, DotNetNuke, Web Development.

In DotNetNuke MVP Module Development: Tip #1 The AutoDataBind Property I suggested to use AutoDatBind to automatically bind up the user control.  However, there are times when no binding should occur.  For example, when a Cancel button is clicked the view should not be bound.  AutoDataBind should be disabled when no model is need. protected… Read more »

DotNetNuke MVP Module Development: Tip #1 The AutoDataBind Property

Posted by & filed under Development, DotNetNuke.

The DotNetNuke.Web.Mvp.ModuleViewBase sets a property called AutoDataBind = true. As a result the DataBind() method for the page is always called in the Page_PreRenderComplete event. If you use the following familiar snippet of code you find that your controls will be data bound twice. Once when your code calls DataBind() and a second time when… Read more »

Search and Replace – Text/HTML – DotNetNuke 5.5

Posted by & filed under DotNetNuke.

I couldn’t get the Engage: F3 module to work with DotNetnuke 5.5 due to a known issue.  This issue will be fixed when Engage: F3 3.4 is released.  However, if you need a quick fix until then you can use this script based on the F3 module. WARNING:  Backup your database before executing this script…. Read more »