日期:2014-05-20  浏览次数:20520 次

asp.net中实现大图生小图在vs2003中会报黄页vs2005中正常(c#)请高手解决!!!!
前台
<%@   Page   language= "c# "   Codebehind= "WebForm1.aspx.cs "   AutoEventWireup= "false "   Inherits= "mytest.WebForm1 "   %>
<!DOCTYPE   HTML   PUBLIC   "-//W3C//DTD   HTML   4.0   Transitional//EN "   >
<HTML>
<HEAD>
<title> WebForm1 </title>
<meta   name= "GENERATOR "   Content= "Microsoft   Visual   Studio   .NET   7.1 ">
<meta   name= "CODE_LANGUAGE "   Content= "C# ">
<meta   name= "vs_defaultClientScript "   content= "JavaScript ">
<meta   name= "vs_targetSchema "   content= "http://schemas.microsoft.com/intellisense/ie5 ">
</HEAD>
<body>
<form   id= "Form1 "   method= "post "   runat= "server ">
<P>
<input   type= "file "   id= "FileUp "   runat= "server ">
<br>
</P>
<P>
<hr>
<P> </P>
<P>
<asp:Button   ID= "Upload "   Text= "开始上传 "   Runat= "server "> </asp:Button> </P>
<P>
<asp:Image   id= "Big "   runat= "server "   AlternateText= "原图 "   Visible= "False "> </asp:Image>
生成的小图:
<asp:Image   ID= "Small "   AlternateText= "小图 "   Visible= "False "   Runat= "server "> </asp:Image>
</P>
<br>
<div   id= "Message "   Visble= "false "   runat= "server ">
<asp:Label   ID= "info "   Runat= "server "> </asp:Label> <br>
</div>
</form>
</body>
</HTML>

后台


using   System;
using   System.Collections;
using   System.ComponentModel;
using   System.Data;
using   System.Drawing;
using   System.Web;
using   System.Web.SessionState;
using   System.Web.UI;
using   System.Web.UI.WebControls;
using   System.Web.UI.HtmlControls;
using   System.IO;
using   System.Drawing.Imaging;

namespace   mytest
{
///   <summary>
///   WebForm1   的摘要说明。
///   </summary>
public   class   WebForm1   :   System.Web.UI.Page
{
protected   System.Web.UI.WebControls.Button   Upload;
protected   System.Web.UI.WebControls.Image   Big;
protected   System.Web.UI.WebControls.Image   Small;
protected   System.Web.UI.WebControls.Label   info;
protected   System.Web.UI.HtmlControls.HtmlGenericControl   Message;
protected   System.Web.UI.HtmlControls.HtmlInputFile   FileUp;

private   void   Page_Load(object   sender,   System.EventArgs   e)
{
//   在此处放置用户代码以初始化页面

}

#region   Web   窗体设计器生成的代码
override   protected   void   OnInit(EventArgs   e)
{
//
//   CODEGEN:   该调用是   ASP.NET   Web   窗体设计器所必需的。
//
InitializeComponent();