程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 編程語言 >> .NET網頁編程 >> C# >> C#入門知識 >> C#圖片上傳後果實例剖析

C#圖片上傳後果實例剖析

編輯:C#入門知識

C#圖片上傳後果實例剖析。本站提示廣大學習愛好者:(C#圖片上傳後果實例剖析)文章只能為提供參考,不一定能成為您想要的結果。以下是C#圖片上傳後果實例剖析正文


本文實例講述了C#圖片上傳後果完成辦法。分享給年夜家供年夜家參考。詳細以下:

<%@ Page Title="" Language="C#" MasterPageFile="~/Default.master" AutoEventWireup="true"
 CodeFile="Default.aspx.cs" Inherits="Default" %>
<asp:Content ID="cHead" ContentPlaceHolderID="head" runat="Server">
</asp:Content>
<asp:Content ID="cBody" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
<asp:Literal runat="server" ID="ltrHTML"></asp:Literal>
<script type="text/javascript">
    $().ready(function () {
       var counter = 0;
       $(function () {
         var btnUpload = $('#addImage');
         new AjaxUpload(btnUpload, {
          action: 'saveupload.aspx',
          name: 'uploadfile',
           onSubmit: function (file, ext) {
             $("#loading").show();
           },
           onComplete: function (file, response) {
             var uploadedfile = "UserData/" + file;
             $("#uploadImageWrapper").append("<div class='imageContainer offset' id='current" + counter + "'><img height='65px' width='65px' src='" + uploadedfile + "' alt='" + uploadedfile + "'/><div id='close" + counter + "' class='close' title='" + uploadedfile + "' onclick='RemoveImage(this);'><a ></a></div></div>");
             $('#current' + counter).fadeIn('slow', function () {
              $("#loading").hide();
               $("#message").show();
               $("#message").html("Added successfully!");
               $("#message").fadeOut(3000);
               counter++;
             });
           }
         });
       });
    });
     function RemoveImage(_this) {
       var counter = _this.id.replace('close', '');
       $("#loading").show();
       $.ajax({
         type: "POST",
         url: "removeupload.aspx",
         data: "filename=" + _this.getAttribute('title'),
         success: function (msg) {
           $('#current' + counter).fadeOut('slow', function () {
             $("#loading").hide();
             $("#message").show();
             $("#message").html("Removed successfully!");
             $("#message").fadeOut(3000);
           });
         }
       });
     }
   </script>
   <table id="imageUploader" cellpadding="0" cellspacing="0">
     <tr class="header">
       <td >
         <a id="addImage" href="javascript:;">Add Image</a>
       </td>
     </tr>
     <tr class="body">
       <td valign="top">
         <div id="uploadImageWrapper">
         </div>
       </td>
     </tr>
     <tr class="footer">
       <td>
         <div id="loading" >
           <table cellpadding="0" cellspacing="0">
             <tr>
               <td>
                 <img width="20" height="20" src="Images/Loading.gif" alt="Loading..." />
               </td>
               <td>
                Please wait...
               </td>
             </tr>
           </table>
         </div>
         <div id="message" >
         </div>
       </td>
     </tr>
   </table>
 </asp:Content>

願望本文所述對年夜家的C#法式設計有所贊助。

  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved