温馨提示:代码在线浏览功能只能做为源码浏览参考,如果想更进一步了解该代码请下载:Asp.net+Flash实现无刷新上传
当前文件:
FlashUpload/Default.aspx,打开代码结构图
FlashUpload/Default.aspx,打开代码结构图1<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %> 2
3
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 4
5
<html xmlns="http://www.w3.org/1999/xhtml" > 6
<head runat="server"> 7
<title>Flash Upload</title> 8
</head> 9
<body> 10
<form id="form1" runat="server" enctype="multipart/form-data" method="POST"> 11
<div> 12
<%-- 13
14
Adding the flash uploader to the page. <param name="wmode" value="transparent"> makes 15
the movie transparent so any page styling can shine through. 16
FlashVars is set to pass in the upload page and a javascript function if desired. 17
The javascript function fires when the upload is completed. This allows us to 18
call a codebehind function to refresh a gridView or anything else. 19
A link button is used to perform this function. The javascript is added in the pageLoad 20
in the code behin. 21
To edit the flash file, Adobe/Macromedia has a 30-day trial of Macromedia Flash 22
for download. After that, you're on your own. 23
--%> 24
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" 25
codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" 26
width="550" height="100" id="fileUpload" align="middle"> 27
<param name="allowScriptAccess" value="sameDomain" /> 28
<param name="movie" value="fileUpload.swf" /> 29
<param name="quality" value="high" /> 30
<param name="wmode" value="transparent"> 31
<PARAM NAME=FlashVars VALUE='uploadPage=Upload.axd<%=GetFlashVars()%>&completeFunction=UploadComplete()'> 32
<embed src="fileUpload.swf" 33
FlashVars='uploadPage=Upload.axd<%=GetFlashVars()%>&completeFunction=UploadComplete()' 34
quality="high" wmode="transparent" width="550" height="100" 35
name="fileUpload" align="middle" allowScriptAccess="sameDomain" 36
type="application/x-shockwave-flash" 37
pluginspage="http://www.macromedia.com/go/getflashplayer" /> 38
</object> 39
<%--This link button is here so we can call the LinkButton1_Click even from javascript. 40
Make the text empty so the link doesn't show up on the page.--%> 41
<asp:LinkButton ID="LinkButton1" runat="server" OnClick="LinkButton1_Click"></asp:LinkButton> 42
</div> 43
44
</form> 45
46
<a href="http://www.51aspx.com" target="_blank">download from 51aspx.com</a> 47
48
</body> 49
</html> 50




