- <p><div class="blockcode"><blockquote> protected void Page_Load(object sender, EventArgs e)
- {
- if (IsPostBack)
- {
- C1Upload1.TargetFolder = HiddenField1.Value;
- UpdatePanel1.Update();
- }
- }
复制代码
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title></title>
<style type="text/css">
</style>
</head>
<body>
<form id="form1" runat="server">
<div>
<cc1:C1FileExplorer ID="C1FileExplorer1" InitPath="./picture" AllowMultipleSelection="true" EnableCopy="true" EnableOpenFile="true" EnableCreateNewFolder="true" AccessKey="k" runat="server" Shortcuts-Back="{Ctrl}+{b}" ContextMenu="{Shift}+{c}" FocusAddressBar="{Shift}+{a}" FocusGrid="{Shift}+{g}" FocusGridPagingSlider="{Shift}+{1}"
FocusTreeView="{Shift}+{2}" Forward="{Ctrl}+{f}" NewFolder="{Ctrl}+{Shift}+{N}" FocusFileExplorer="{Ctrl}+{K}" AllowPaging="true" PageSize="5" ></cc1:C1FileExplorer>
<asp:ImageButton ID="ImageButton1" runat="server" ImageUrl="~/Images/UploadFile.png"/>
<asp:HiddenField ID="HiddenField1" runat="server" />
<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
<div runat="server" id="dialog">
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional" EnableViewState="False" ChildrenAsTriggers="False">
<Triggers>
<asp:AsyncPostBackTrigger ControlID="ImageButton1" />
</Triggers>
<ContentTemplate>
<aspabel ID="Label1" runat="server" Text=""></aspabel>
<wijmo:C1Upload ID="C1Upload1" runat="server" Width="600px" ShowUploadedFiles="true" />
</ContentTemplate>
</asp:UpdatePanel>
</div>
<script type="text/javascript">
function uploadComplete()
{
$('#<%=dialog.ClientID%>').wijdialog("close");
$("#<%=C1FileExplorer1.ClientID %>").c1fileexplorer("refresh");
}
function showDialog()
{
var currentFolder = $("#<%=C1FileExplorer1.ClientID %>").c1fileexplorer("option", "currentFolder");
$('#<%=HiddenField1.ClientID%>').val(currentFolder);
$('#<%=Label1.ClientID%>').text("lease wait...");
$('#<%=C1Upload1.ClientID%>').hide();
$('#<%=dialog.ClientID%>').wijdialog({ title: "Upload to: " + currentFolder }).wijdialog("open");
}
$(function () {
$('#<%=dialog.ClientID%>').wijdialog({
autoOpen: false,
modal: true,
resizable: true,
width: 640,
height: 400,
buttons: {
Close: function () {
$(this).wijdialog("close");
}
},
captionButtons: {
pin: { visible: false },
refresh: { visible: false },
toggle: { visible: false },
minimize: { visible: false },
maximize: { visible: false }
}
});
var uploadButtonPanel = $('<li title="Upload File" class="ui-state-default ui-corner-all uploadbutton"><a class="wijmo-wijfileexplorer-link" href="#"></a></li>');
uploadButtonPanel.find("a.wijmo-wijfileexplorer-link").append($('#<%=ImageButton1.ClientID%>'));
$("#<%=C1FileExplorer1.ClientID %>").find("ul.wijmo-wijfileexplorer-toolbar").append(uploadButtonPanel);
});
</script>
</div>
</form>
</body>
</html>
|