Dear developers hello,
I use RadExplorer, in my classic website, with the option to download (or open) files with double click. It works great.
Now i changed my pages and i use Master and Content pages, instead of classic.
RadExplorer is in the Content Page of a Master Page.
After that change, the download is not working. I double click the file and it does nothing (download or open).
The file Handler.ashx is the same.
I use:
Visual Studio 2008 v9.0.30729.1 SP (ASP.NET Visual Basic)
If you need any other information, please let me know.
Thank you in advance for your time.
Best Regards
Navarino Technology Department
Below you will find the code of my content page.
I use RadExplorer, in my classic website, with the option to download (or open) files with double click. It works great.
Now i changed my pages and i use Master and Content pages, instead of classic.
RadExplorer is in the Content Page of a Master Page.
After that change, the download is not working. I double click the file and it does nothing (download or open).
The file Handler.ashx is the same.
I use:
Visual Studio 2008 v9.0.30729.1 SP (ASP.NET Visual Basic)
RadControls for ASP.NET Ajax 2010.2.929.35 Trial
Windows 7If you need any other information, please let me know.
Thank you in advance for your time.
Best Regards
Navarino Technology Department
Below you will find the code of my content page.
<%@ Page Title="" Language="VB" MasterPageFile="~/mpMainMenu.master" AutoEventWireup="true" CodeFile="cInvoices.aspx.vb" Inherits="cInvoices" %>
<%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %>
<
asp:Content
ID
=
"Content2"
ContentPlaceHolderID
=
"ContentPlaceHolder1"
Runat
=
"Server"
>
<
p
>
<
span
class
=
"style1"
>
<
telerik:RadScriptManager
ID
=
"RadScriptManager1"
runat
=
"server"
>
</
telerik:RadScriptManager
>
Welcome</
span
>
<
asp:Label
ID
=
"lblUserName"
runat
=
"server"
CssClass
=
"style1"
Text
=
"User"
>
</
asp:Label
>
<
span
class
=
"style1"
>.
<
br
/>
You can download or open the selected file (according the selection below), with
double click.
<
br
/>
</
span
>
<
asp:RadioButton
ID
=
"rbDownload"
runat
=
"server"
Checked
=
"True"
CssClass
=
"style1"
GroupName
=
"MyGroup"
Text
=
"Download (Save the file to your computer)"
/>
<
asp:RadioButton
ID
=
"rbOpen"
runat
=
"server"
CssClass
=
"style1"
GroupName
=
"MyGroup"
Text
=
"Open (Open the file in Viewer)"
/>
</
p
>
<
p
>
<
telerik:RadFileExplorer
ID
=
"RadFileExplorer1"
Runat
=
"server"
Skin
=
"Office2007"
OnClientFileOpen
=
"OnClientFileOpen"
EnableOpenFile
=
"true"
EnableCreateNewFolder
=
"False"
VisibleControls
=
"TreeView, Grid, ContextMenus"
style
=
"text-align: left"
Height
=
"452px"
Width
=
"725px"
>
<
Configuration
SearchPatterns
=
"*.*"
></
Configuration
>
</
telerik:RadFileExplorer
>
</
p
>
<
script
type
=
"text/javascript"
>
//
<![CDATA[
function OnClientFileOpen(oExplorer, args) {
var item = args.get_item();
var fileExtension = item.get_extension();
var fileDownloadMode = document.getElementById("rbDownload").checked;
if ((fileDownloadMode == true) && (fileExtension == "jpg" || fileExtension == "pdf")) {// Download the file
// File is a image document, do not open a new window
args.set_cancel(true);
// Tell browser to open file directly
var requestImage = "Handler.ashx?path=" + item.get_url();
document.location = requestImage;
}
setTimeout(function() {
var oWindowManager = oExplorer.get_windowManager();
var previewWinow = oWindowManager.getActiveWindow(); // Gets the current active widow
previewWinow.setSize(500, 500); // Set the new size of the window
}, 100); // Some timeout is required in order to allow the window to become active
}
//]]>
</
script
>
</
asp:Content
>