HyperLink for files with spaces in the path not working in Internet Explorer.

I was using asp:hyperlink  control to show links to local LAN files , e.g.

<asp:HyperLink ID="lnkToClick" runat="server">link to LAN fileasp:HyperLink>

 Me.lnkToClick.NavigateUrl = file://\\Server\Folder\FileName.ext

 It worked fine, unless Folder path or filename has spaces in it(Probably other special character could cause the same problem). In this case, generated html file has %20 instead of space and clicking on the generated link in IE doesn't open file.
In othe words Internet Explorer 6. doesn't open the following link
        file://\\database\docs\sally\staff' _fcksavedurl='file://\\Server\Folder\TWO%20WORDS.doc">file://\\database\docs\sally\staff'>file://\\Server\Folder\TWO%20WORDS.doc">file://\\Server\Folder\TWO WORDS.doc

After some investigation with Reflector I found that HyperLink calls AddAttributesToRender, which calls  ResolveClientUrl, which in turn calls  HttpUtility.UrlPathEncode. And there is no simple way to exclude encoding for “file://“ paths.
There is ASP.NET 2.0  asp:hyperlink  control bug, the control worked correctly in ASP.NET 1.1 .

However ther is a simple alternative -use A control instead of HyperLink.

<a ID="lnkToClick" runat="server">link to LAN file</a>

 

 Me.lnkToClick.href = file://\\Server\Folder\FileName.ext

The similar problem is reported to MS here.

One reader of the post asked how to replace  
<asp:HyperLink runat="server" Target="_blank" Text="<img src=pdficon_small.gif border=0 align=absmiddle alt='Load PDF File'>" NavigateUrl='<%# DataBinder.Eval(Container, "DataItem.FilePath") %>'>
</asp:HyperLink>

My suggestion was:

<a runat="server" target="_blank"  href='<%# DataBinder.Eval(Container, "DataItem.FilePath") %>'>
<img src=pdficon_small.gif border=0 align=absmiddle alt='Load PDF File'>
</a>

DotNetNuke: InstallationDate entry in web.Config can be missing.

We had couple sites when during install of DotNetNuke(4.0.3) there was a known "Nothing to Install At This Time" message.
I've tried to investigate , how it could happen.
At the first installation the function Install.InstallApplication (Install\Install.aspx.vb) checks web.config file.
If InstallationDate  is missing, it tries to call Config.UpdateMachineKey, which should add InstallationDate element and save web.config.
If the save not succced, the DotNetNuke Configuration Error“ error(403-3.htm) is reported.
However if the new DotNetNuke Web Application  with web.config file is attached to database with DNN tables installed,
 Install.InstallApplication is not called and InstallationDate element is not added.

However in event handler Application_BeginRequest(App_Code\Global.asax.vb) web.config file is checked if InstallationDate  is missing:
            Dim installationDate As String = Config.GetSetting("InstallationDate")
            If installationDate Is Nothing Or installationDate = "" Then
                Response.Redirect("~/Install/Install.aspx?mode=none")
            End If

mode=none invokes NoUpgrade() method(Install\Install.aspx.vb) which doesn't do any installation, but compares database and assembly version and shows link to install or shows  "Nothing to Install At This Time" message.

It will be good if
1.NoUpgrade() name will be changed to more descriptive WriteResponseIfUpdatesRequired
2.the function will also check
InstallationDate element in web.config and add clear instruction/link to update if the element is missing.

I've posted my suggestion to DNN support
 

«July»
SunMonTueWedThuFriSat
2526272829301
2345678
9101112131415
16171819202122
23242526272829
303112345