zoukankan      html  css  js  c++  java
  • ASP.NET简单文件上传

    aspx代码 

    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="UploadFile.aspx.cs" Inherits="testNet.Re.UploadFile" %>

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head>
        
    <title>简单文件上传</title>
    <script type="text/javascript" src="/js/jquery-1.2.6.min.js"></script>
    <script type="text/javascript">
    var fupExcel;
    var hfldFilePath;

    $().ready(
    function()
    {   
        fupExcel 
    = $("#<%= fupExcel.ClientID %>");
        hfldFilePath 
    = $("#<%= hfldFilePath.ClientID %>");
        btnUpload 
    = $("#<%= btnUpload.ClientID %>");
        
        btnUpload.click(
    function()
        {
            hfldFilePath.val(fupExcel.val());
        });
    });
    </script>
    </head>
    <body>
        
    <form id="form1" runat="server">
        
    <div>
            
    <asp:FileUpload ID="fupExcel" runat="server" />
            
    <asp:Button ID="btnUpload" runat="server" Text="上传" OnClick="btnUpload_Click" />
            
    <asp:HiddenField ID="hfldFilePath" runat="server" />
            
    <br />
            
    <asp:TextBox ID="txtFilePath1" runat="server" Width="262px"></asp:TextBox><br />
            
    <asp:TextBox ID="txtFilePath2" runat="server" Width="262px"></asp:TextBox>
            
    <br />
            
    <asp:Label ID="lblMessage" runat="server"></asp:Label></div>
        
    </form>
    </body>
    </html>

    cs代码

    Code
  • 相关阅读:
    python--DAY7面向对象进阶
    python--socket实例
    Python---day5-各类模块的使用
    python--day4--迭代器、生成器
    Python--三元运算与lambda表达式
    python--函数式登录程序
    Python--变量作用域
    Python--函数
    Python----文件的IO操作
    swagger2文档的步骤
  • 原文地址:https://www.cnblogs.com/llcto/p/1376353.html
Copyright © 2011-2022 走看看