找回密码
 立即注册

QQ登录

只需一步,快速开始

zhuyinyin_66
高级会员   /  发表于:2016-4-11 10:21  /   查看:6848  /  回复:10
  1. <p><div class="blockcode"><blockquote>        protected void Page_Load(object sender, EventArgs e)
  2.         {
  3.             if (IsPostBack)
  4.             {
  5.                 C1Upload1.TargetFolder = HiddenField1.Value;
  6.                 UpdatePanel1.Update();
  7.             }
  8.         }
复制代码


<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>

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?立即注册

x

10 个回复

倒序浏览
zhuyinyin_66
高级会员   /  发表于:2016-4-11 10:23:22
沙发
http://gcdn.gcpowertools.com.cn/ ... ght=file%2Bexplorer
和这个例子上的代码是一样的
回复 使用道具 举报
zhuyinyin_66
高级会员   /  发表于:2016-4-11 10:24:09
板凳
实际的文件夹中有这个文件,但在浏览器中看不到
回复 使用道具 举报
zhuyinyin_66
高级会员   /  发表于:2016-4-11 10:24:14
地板
实际的文件夹中有这个文件,但在浏览器中看不到
回复 使用道具 举报
Alice
社区贡献组   /  发表于:2016-4-11 11:46:18
5#
我是用在线示例测试上传的图片,可以展示。http://demo.gcpowertools.com.cn/ ... rer/UploadFile.aspx

经过电话沟通,我会测试zip其他类型的文档,然后给您个反馈。
请点击评分,对我的服务做出评价!  5分为非常满意!

葡萄城控件服务团队

官方网站: http://www.gcpowertools.com.cn
回复 使用道具 举报
Alice
社区贡献组   /  发表于:2016-4-11 12:12:55
6#
zhuyinyin_66 发表于 2016-4-11 10:24
实际的文件夹中有这个文件,但在浏览器中看不到

上传控件的方法可以参考如下示例:
http://demo.gcpowertools.com.cn/ ... rer/UploadFile.aspx
Documents\ComponentOne Samples\ASP.NET Web Forms\WebForms\CS\ControlExplorer\C1FileExplorer\UploadFile

示例里做了属性设置(SearchPatterns属性),所以只能展示图片类型。
SearchPatterns="*.jpg,*.png,*.jpeg,*.gif"

你把这句代码删除,或是改成SearchPatterns="*",就可以显示所有类型。
请点击评分,对我的服务做出评价!  5分为非常满意!

葡萄城控件服务团队

官方网站: http://www.gcpowertools.com.cn
回复 使用道具 举报
zhuyinyin_66
高级会员   /  发表于:2016-4-11 12:52:12
7#
能给我一个现成的demo吗
回复 使用道具 举报
zhuyinyin_66
高级会员   /  发表于:2016-4-11 12:59:17
8#
Alice 发表于 2016-4-11 12:12
上传控件的方法可以参考如下示例:
http://demo.gcpowertools.com.cn/ ... rer/UploadFile.aspx
Docume ...

已经好了,谢谢,就是,少了SearchPatterns="*" 这句话
回复 使用道具 举报
zhuyinyin_66
高级会员   /  发表于:2016-4-11 12:59:23
9#
Alice 发表于 2016-4-11 12:12
上传控件的方法可以参考如下示例:
http://demo.gcpowertools.com.cn/ ... rer/UploadFile.aspx
Docume ...

已经好了,谢谢,就是,少了SearchPatterns="*" 这句话
回复 使用道具 举报
Alice
社区贡献组   /  发表于:2016-4-11 13:52:32
10#
zhuyinyin_66 发表于 2016-4-11 12:59
已经好了,谢谢,就是,少了SearchPatterns="*" 这句话

好的,谢谢您的反馈。
请点击评分,对我的服务做出评价!  5分为非常满意!

葡萄城控件服务团队

官方网站: http://www.gcpowertools.com.cn
回复 使用道具 举报
12下一页
您需要登录后才可以回帖 登录 | 立即注册
返回顶部