Tuesday, September 18, 2012

dnnAlert and dnnConfirm jQuery Plugin

I like the idea of using jQuery Plugins in DNN for interactive and consistent user interface which is why I digg into using dnnAlert and dnnConfirm plugins, however after a quick look on the documentation I notice the following.

For dnnAlert you can't set the title. We are allowed to set the OK button text using okText option but not the dialog title?

For dnnConfirm. This is very usefull when you just want a confirmation dialog upon click on your button or link however you can't use it like javascript confirm function or at least I don't know how to use it like below:

if(confirm('Question?')){//some code}

Tuesday, September 11, 2012

jQuery AJAX Cache Issue with IE

If you are having issue with jquery ajax api in IE where it keeps returning the same set of results over and over again. set cache option to false. So for example instead of using

$.ajax({ url: surl, dataType: 'json' }).done(function (data) { });


$.ajax({ url: surl, dataType: 'json', cache: false }).done(function (data) { });


Monday, September 10, 2012

Hide New Message Count in DotNetNuke Profile Link

If you use a custom messaging module in dotnetnuke and don't want to see the new message count from DNN built in Messaging Module set dnnUSER skin object ShowUnreadMessages property to false.

<dnn:USER runat="server" id="dnnUSER" CssClass="register" ShowUnreadMessages="false" />


Monday, August 27, 2012

Export Crystal Report to PDF using VB.Net for Download in your DotNetNuke site

The code below will force download of PDF version of you crystal report in DotNetNuke. This code is base on this article.
' Create a temporary filename
Dim strPDF As String = MapPath("Reports/TO" & Session.SessionID & ".pdf")

' Create report
Dim rpt As New TravelOrderList

' Set report params
'rpt.SetParameterValue("ReportTitle", "Report Title")
'rpt.SetParameterValue("ReportSubTitle", "Sub Title")

' Set report datasource
Dim CrExportOptions As ExportOptions Dim CrDiskFileDestinationOptions As New DiskFileDestinationOptions() Dim CrFormatTypeOptions As New PdfRtfWordFormatOptions() CrDiskFileDestinationOptions.DiskFileName = strPDF CrExportOptions = rpt.ExportOptions With CrExportOptions .ExportDestinationType = ExportDestinationType.DiskFile .ExportFormatType = ExportFormatType.PortableDocFormat .DestinationOptions = CrDiskFileDestinationOptions .FormatOptions = CrFormatTypeOptions End With rpt.Export() ' Force download(in DNN) FileSystemUtils.DownloadFile(strPDF) ' Delete temp file IO.File.Delete(strPDF)


Tuesday, August 14, 2012

Bind all DotNetNuke portal alias to a dropdownlist

Dim objAlias As PortalAliasCollection = PortalAliasController.GetPortalAliasLookup()
For Each obj As System.Collections.DictionaryEntry In objAlias
   ddlPortalAlias.Items.Add(CType(obj.Value, PortalAliasInfo).HTTPAlias)
ddlPortalAlias.SelectedValue = PortalSettings.DefaultPortalAlias


Monday, August 13, 2012

Update DesktopModule Category

The code below will add a new category to dotnetnuke module category list.
 ' Update module category
Dim desktopModule As DesktopModuleInfo = DesktopModuleController.GetDesktopModuleByModuleName("DNNSEO", Null.NullInteger)


desktopModule.Category = "Vivoware"

DesktopModuleController.SaveDesktopModule(desktopModule, False, False)
For some reason I had to edit the desktop module, set the category and save for it to be visible in the list of modules when the category I created is selected. Screenshoot.

Tuesday, August 7, 2012

Failure Error: Unable to generate a temporary class...

I have encounter this error while installing DotNetNuke 6.2 in a new machine. and got the solution from a 1 year old blog entry. The Solution: Give IIS_IUSRS Full Access to Windows\Temp folder

Wednesday, August 1, 2012

How to prevent page scroll when showing jQuery Dialog

Sometimes showing a jQuery Dialog in a scrolling page sucks so to hide scroll bars(prevent scrolling) use the following code.
$( ".selector" ).dialog({
   open: function(event, ui) { jQuery("#Body").css("overflow", "hidden"); },
   close: function () { jQuery("#Body").css("overflow", "auto"); }