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之Http Web服务(网页抓取二)
    分享:C语言打印long long类型
    分享:svn 添加*.so等文件
    visual assist x 安装
    设计模式之MVC模式
    php一个递归读取目录文件脚本
    转:javax.swing.JFrame中使用jpanel来布局
    alter table 总结
    php 函数:func_get_args()、func_get_arg()与func_num_args()
    Visual Assist X简介
  • 原文地址:https://www.cnblogs.com/llcto/p/1376353.html
Copyright © 2011-2022 走看看