uploadTemplate.aspx
上传用户:lanchensha
上传日期:2022-02-27
资源大小:7530k
文件大小:9k
源码类别:

编辑器/阅读器

开发平台:

C#

  1. <%@ Page Language="C#" AutoEventWireup="true" ValidateRequest="false" Inherits="DotNetTextBox.UpLoad"%>
  2. <%@ Import Namespace="DotNetTextBox" %>
  3. <html>
  4. <head>
  5. <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
  6. <base target="_self" />
  7. <script language="javascript" type="text/javascript">
  8. var userAgent = navigator.userAgent.toLowerCase();
  9. var is_ie = (userAgent.indexOf('msie') != -1);
  10. function loading() 
  11. {
  12.     document.getElementById("loading").style.visibility="visible";
  13.     return true;
  14. }
  15. function insertTemplate()
  16. {
  17.     if(document.getElementById("file_path").value!="")
  18.     {
  19.     if(is_ie)
  20.     {
  21.     window.returnValue = document.getElementById("templateContent").value;
  22.     }
  23.     else
  24.     {
  25.     window.opener.inserObject(null,'template',document.getElementById("templateContent").value);
  26.     }
  27.     }
  28.     window.close();
  29. }
  30. function add(name) 
  31. {
  32.     if(is_ie)
  33.     {
  34.     var path=document.getElementById("path").innerText;
  35.     }
  36.     else
  37.     {
  38.     var path=document.getElementById("path").textContent;
  39.     }
  40.     document.getElementById("file_path").value=path+name;
  41.     document.getElementById("file_path").focus();
  42. }
  43. var sTitle='<%=ResourceManager.GetString("uploadtemplate")%>';
  44. window.focus();
  45. document.write("<TITLE>" + sTitle + "</TITLE>");
  46. </script>
  47. <link href="stylesheet.css" rel="stylesheet" type="text/css" />
  48. </head>
  49. <body topmargin="0">
  50.     <form id="uploadFace" runat="server">
  51.         <table border="0" align=center style="word-break:break-all" width="100%">
  52.             <tr>
  53.                 <td colspan="3" rowspan="3">
  54.                     <fieldset><legend><span style="color: darkgray"><span style="color: gray"><%=ResourceManager.GetString("uploadface")%></span>&nbsp;
  55.                     </span></legend>
  56.         <%=ResourceManager.GetString("uploadpath")%>:<asp:Label ID="path" runat="server" ForeColor="Black"></asp:Label><br />
  57.         <%=ResourceManager.GetString("uploadfiles")%>:<asp:FileUpload ID="FileUpload1" runat="server" Width="388px" Height="21px" TabIndex="2" Font-Size="10pt" />
  58.         <asp:Button ID="uploadBtn" runat="server" OnClientClick="loading()" OnClick="UploadBtn_Click"/><br />
  59.         <%=ResourceManager.GetString("filepath")%>:<asp:TextBox ID="file_path" runat="server" Width="316px" TabIndex="1"></asp:TextBox>
  60.                         <asp:Button ID="insertTemplate" runat="server" OnClick="insertTemplate_Click" /><br />
  61.                         [ <%=ResourceManager.GetString("uploaduse")%>:<asp:label ID="useSpace" ForeColor="Red" runat=server />,<%=ResourceManager.GetString("have")%>:<asp:label ID="space" ForeColor="Red" runat=server /><%=ResourceManager.GetString("singlesize")%>:<asp:Label ID="maxSingleUploadSize" runat="server" ForeColor="Red"></asp:Label>
  62.                         ]</fieldset>
  63.                     <br /><fieldset style="text-align: center"><legend><span style="color: darkgray"><span style="color: gray"><%=ResourceManager.GetString("filelist")%></span>&nbsp;
  64.                     </span></legend>
  65.         <div id="fileshow" style="border-right: 1.5pt inset; border-top: 1.5pt inset; vertical-align: middle;
  66.             overflow: auto; border-left: 1.5pt inset; width: 100%; border-bottom: 1.5pt inset;
  67.             height: 240px; background-color: white">
  68. <asp:GridView runat="server" id="File_List" HeaderStyle-HorizontalAlign=Center AutoGenerateColumns="False" HeaderStyle-BackColor="buttonface" HeaderStyle-ForeColor=windowtext Width="100%" BorderWidth="1px" OnRowCancelingEdit="File_List_RowCancelingEdit" OnRowUpdating="File_List_RowUpdating">
  69.   <Columns>
  70.   <asp:TemplateField>
  71.         <HeaderTemplate>
  72.                 <asp:CheckBox ID="checkall" runat="server" Text=<%#ResourceManager.GetString("selectall")%> AutoPostBack="true" OnCheckedChanged="checkAll" />
  73.          </HeaderTemplate>
  74.           <ItemTemplate>
  75.                    <asp:CheckBox ID="check" runat="server" />
  76.             </ItemTemplate>     
  77.             <ItemStyle HorizontalAlign="Center" Width="55px" />
  78. </asp:TemplateField>
  79.     <asp:TemplateField>
  80.     <EditItemTemplate>
  81.     <asp:TextBox ID="editName" Text=<%#DataBinder.Eval(Container.DataItem,"Name").ToString().Remove(DataBinder.Eval(Container.DataItem,"Name").ToString().LastIndexOf(DataBinder.Eval(Container.DataItem,"Extension").ToString()))%> Width="100px" runat=server></asp:TextBox> <asp:Button ID="editBtn" CommandName="Update" CommandArgument=<%#DataBinder.Eval(Container.DataItem,"Name")%> runat=server Text=<%#ResourceManager.GetString("edit")%> /> <asp:Button ID="Cancel" runat=server Text=<%#ResourceManager.GetString("cancel")%> CommandName="Cancel" />
  82.     </EditItemTemplate>
  83.     <ItemTemplate>
  84.     <img src="img/filetype/<%#DataBinder.Eval(Container.DataItem,"Attributes").ToString().ToLower()=="directory"?"folder":((string)DataBinder.Eval(Container.DataItem,"Extension")).Replace(".","")%>.gif" /><asp:Label ID="ListID" Text=<%#DataBinder.Eval(Container.DataItem,"Name")%> style="cursor:pointer; word-break:break-all" onmouseover="this.style.textDecoration='underline'" onmouseout="this.style.textDecoration='none'" onclick=<%#DataBinder.Eval(Container.DataItem,"Name","javascript:add("{0}")")%> runat=server />
  85.     </ItemTemplate>
  86.     </asp:TemplateField>
  87.     <asp:BoundField DataField="LastWriteTime" ReadOnly="True" HtmlEncode=False DataFormatString="{0:D}" >
  88.         <ItemStyle HorizontalAlign="Center" Width="25%" />
  89.     </asp:BoundField>
  90.     <asp:BoundField DataField="Length" ReadOnly="True" HtmlEncode=False DataFormatString="{0:#,### Bytes}" >
  91.         <ItemStyle HorizontalAlign=Center Width="25%" />
  92.     </asp:BoundField>
  93.   </Columns>
  94. <HeaderStyle ForeColor="WindowText" BackColor="Control" BorderWidth="1px" HorizontalAlign="Center" />
  95. </asp:GridView></div><table width="100%" border="0px"><tr><td>
  96.     [<%=ResourceManager.GetString("controlmenu")%>]:<asp:button id="selectAllBtn" runat="server"  borderstyle="Dashed" onclick="selectAllBtn_Click"></asp:button>
  97.     <asp:Button ID="deleteBtn" runat="server" BorderStyle="Dashed" OnClick="deleteBtn_Click" />&nbsp;<asp:button id="editBtn" runat="server" borderstyle="Dashed" onclick="editBtn_Click" ></asp:button>
  98.     <input language="javascript" onclick="if(is_ie){showModalDialog('find.aspx',this,'dialogWidth:320px;dialogHeight:130px;status:0;scroll:no');}else{window.find();}" type="button" value="<%=ResourceManager.GetString("findfile")%>" />
  99.     <input language="javascript" onclick="window.close();" type="button" value="<%=ResourceManager.GetString("close")%>" /></td>
  100.     <td align="right">
  101.         <img border=0px src="img/logo_S.png" /></td>
  102. </tr></table>
  103.                         </fieldset>
  104.         <asp:HiddenField ID="config_watermark" runat="server" />
  105.         <asp:HiddenField ID="config_watermarkText" runat="server" />
  106.         <asp:HiddenField ID="config_watermarkImages" runat="server" />
  107.         <asp:HiddenField ID="config_watermarkImages_path" runat="server" />
  108.         <asp:HiddenField ID="config_smallImages" runat="server" />
  109.         <asp:HiddenField ID="config_smallImagesName" runat="server" />
  110.         <asp:HiddenField ID="config_maxAllUploadSize" runat="server" />
  111.         <asp:HiddenField ID="config_autoname" runat="server" />
  112.         <asp:HiddenField ID="config_allowUpload" runat="server" />
  113.         <asp:HiddenField ID="config_fileFilters" runat="server" />
  114.         <asp:HiddenField ID="config_maxSingleUploadSize" runat="server" />
  115.         <asp:HiddenField ID="config_fileListBox" runat="server" />
  116.         <asp:HiddenField ID="config_watermarkImagesName" runat="server" />
  117.         <asp:HiddenField ID="config_watermarkName" runat="server" />
  118.         <asp:HiddenField ID="config_smallImagesType" runat="server" />
  119.         <asp:HiddenField ID="config_smallImagesW" runat="server" />
  120.         <asp:HiddenField ID="config_smallImagesH" runat="server" />
  121.         <asp:HiddenField ID="config_type" Value="Template"  runat="server" />
  122.         <asp:HiddenField ID="templateContent" runat="server" />
  123.                 </td>
  124.             </tr>
  125.         </table>
  126.         <div id="loading" style="border-right: #333333 1px dashed; border-top: #333333 1px dashed;
  127.                         font-size: 9pt; visibility: hidden; border-left: #333333 1px dashed;
  128.                         width: 270px; color: #000000; border-bottom: #333333 1px dashed; position: absolute; height: 120px; background-color: #ffffff">
  129.                         <center>
  130.                             <br />
  131.                             <br />
  132.                             <%=ResourceManager.GetString("loading")%></center>
  133.                         <br />
  134.                         <center>
  135.                             <asp:Button ID="canceloading" runat="server" Style="border-top-style: dashed; border-right-style: dashed;
  136.                                 border-left-style: dashed; border-bottom-style: dashed" />&nbsp;</center>
  137.                         <br />
  138.                     </div>
  139.         <script type="text/javascript">
  140. var load=document.getElementById('loading');
  141. window.onload=function(){resizeLoad()};
  142. function resizeLoad()
  143. {
  144. load.style.top = parseInt((document.body.clientHeight-load.offsetHeight)/2+document.body.scrollTop);
  145. load.style.left = parseInt((document.body.clientWidth-load.offsetWidth)/2+document.body.scrollLeft);
  146. }
  147. if(is_ie)
  148. {
  149. document.body.bgColor="ButtonFace";
  150. }
  151. else
  152. {
  153. document.body.bgColor="#E0E0E0";
  154. }
  155. </script>      
  156. </form>
  157. </body>
  158. </html>