日期:2014-05-17  浏览次数:20443 次

ASP.NET上传Excel

点击导入就可以像file控件一下选择文件
选择好了文件点击打开了之后就上传了


大神们有没有解决方案
ASP.NET Excel

------解决方案--------------------
用样式把file 显示出来和button一样
------解决方案--------------------
原理:利用样式,将上传控件透明化,复盖到一个图片或按钮上边
<style>
.MultiFile-applied {
    cursor: pointer;
    outline: medium none;
    vertical-align: middle;
    position:absolute;
    top:0;
    left:0;
    width:50px;
    height:50px;
    z-index:99;
        filter:alpha(opacity=0);   
      -moz-opacity:0;   
      -khtml-opacity: 0;   
      opacity: 0;
}
.MultiFile-wrap {
    /*background: url("/sysImages/work/upload.gif") no-repeat scroll 0 0 transparent;*/
    display: block;
    outline: medium none;
    position:relative;
    cursor:pointer;
}
</style>

              <a id="uploads_wrap" class="MultiFile-wrap">
                <img src="/sysImages/work/upload.gif" width="30" height="30" />
                <iframe src="flow_upload.aspx?no-cache=<%= DateTime.Now.ToString() %>" class="MultiFile-applied" scrolling="no" frameborder="0"></iframe>
              </a>


<%@ Page Language="C#" EnableEventValidation="false" AutoEventWireup="true" CodeBehind="flow_upload.aspx.cs" Inherits="Galsun.HH.FCX.Web.manage.flow.flow_upload" %>

<!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 runat="server">
    <title></title>
    <style>
    body
    {
        padding:0px; margin:0px;
     }
.MultiFile-applied {
    cursor: pointer;
    font-size: 40px;
    margin-left: -450px;
}
    </style>
</head>
<script sr