I’ve finally deployed the DotNetNuke site I’ve been working on. After deployment is when the most obvious things pop up.

For instance, in DotNetNuke when you search for something in the site it will return a list of links to what it finds. What it won’t do is display something friendly like “No Search Results Found” if it doesn’t find anything. Dumb and not very user friendly.

I did find what I thought would be the solution at ecktwo, but it didn’t work in Firefox due to the

document.getElementById("search").innerHTML

which doesn’t work in Firefox within a table, which is what the Search Results are generated using the ASP.NET grid view. So, I thought I’d take a stab at building something that worked for both IE and Firefox.

Make a copy of your admin\Search\SearchResults.ascx file and then open the file in notepad. Apply the following code that I’ve highlighted in red:

<%@ Control Language=”vb” AutoEventWireup=”false” Explicit=”True” Inherits=”DotNetNuke.Modules.SearchResults.SearchResults” CodeFile=”SearchResults.ascx.vb” %>

<asp:Datagrid id=”dgResults” runat=”server” AutoGenerateColumns=”False” AllowPaging=”True” BorderStyle=”None”
PagerStyle-CssClass=”NormalBold” ShowHeader=”False” CellPadding=”4″ GridLines=”None”>
<Columns>
<asp:TemplateColumn>
<ItemTemplate>
<asp:Label id=lblNo runat=”server” Text='<%# DataBinder.Eval(Container, “ItemIndex”) + 1 %>’ CssClass=”SubHead”>
</asp:Label>
</ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn>
<ItemTemplate>
<asp:HyperLink id=”lnkTitle” runat=”server” Name=”result” CssClass=”SubHead” NavigateUrl='<%# FormatURL(DataBinder.Eval(Container.DataItem,”TabId”),
DataBinder.Eval(Container.DataItem,”Guid”)) %>’ Text='<%# DataBinder.Eval(Container.DataItem, “Title”) %>’>
</asp:HyperLink>&nbsp;-
<asp:Label id=”lblRelevance” runat=”server” CssClass=”Normal” Text='<%# FormatRelevance(DataBinder.Eval(Container.DataItem, “Relevance”)) %>’ >
</asp:Label><BR>
<asp:Label id=”lblSummary” runat=”server” CssClass=”Normal” Text='<%# DataBinder.Eval(Container.DataItem, “Description”) + “<br>” %>’ Visible=”<%# ShowDescription() %>”>
</asp:Label>
<asp:HyperLink id=”lnkLink” runat=”server” CssClass=”CommandButton” NavigateUrl='<%# FormatURL(DataBinder.Eval(Container.DataItem,”TabId”),
DataBinder.Eval(Container.DataItem,”Guid”)) %>’ Text='<%# FormatURL(DataBinder.Eval(Container.DataItem,”TabId”),
DataBinder.Eval(Container.DataItem,”Guid”)) %>’>
</asp:HyperLink>&nbsp;-
<asp:Label id=”lblPubDate” runat=”server” CssClass=”Normal” Text='<%# FormatDate(DataBinder.Eval(Container.DataItem, “PubDate”)) %>’>
</asp:Label>
</ItemTemplate>
</asp:TemplateColumn>
</Columns>
<PagerStyle CssClass=”NormalBold” Mode=”NumericPages”></PagerStyle>
</asp:Datagrid>

<div id=”NoResults”>
<h3 class=”red” style=”text-align:center”>No Search Results Found</h3>
</div>
<script language =”Javascript”>
var search;
search = document.getElementsByName(“result”);

if (search.length == 0) {
document.getElementById(“NoResults”).style.display=’block’;
}
else {
document.getElementById(“NoResults”).style.display=’none’;
}
</script>

Be sure to add the Name=”result” snippet to the asp:Hyperlink in the code above. It’s easy to miss.

Save that and you should now have a spiffy new message displayed when no results are found. Use whatever CSS you want to style the message.

I had been struggling with creating an appointment reminder in MS Outlook to be attached to an email. It was for a event registration Intranet application I had been working on. Finally, after getting most of it working, the most annoying part. . .when the VCS calendar file was sent, the time on the appointment was off by 5-6 hours, depending on the event.

Finally, after searching for what seemed like forever, I found the answer.

Outlook calculates the appointment based on GMT and Tennessee is Eastern Time, so that means I need to add +6 to the time zone when making the appointment.

Just one of those weird problems you bang your head on for hours and you finally stumble across a solution that doesn’t even make sense.