ASP.NetÖеļ¸ÖÖÎļþÏÂÔØ·½·¨
//TransmitFileʵÏÖÏÂÔØ
protected void Button1_Click(object sender, EventArgs e)
{
/*
΢ÈíΪResponse¶ÔÏóÌṩÁËÒ»¸öÐµķ½·¨TransmitFileÀ´½â¾öʹÓÃResponse.BinaryWrite
ÏÂÔØ³¬¹ý400mbµÄÎļþʱµ¼ÖÂAspnet_wp.exe½ø³Ì»ØÊÕ¶øÎÞ·¨³É¹¦ÏÂÔØµÄÎÊÌâ¡£
´úÂëÈçÏ£º
*/
Response.ContentType = "application/x-zip-compressed";
Response.AddHeader("Content-Disposition", "attachment;filename=z.zip");
string filename = Server.MapPath("DownLoad/z.zip");
Response.TransmitFile(filename);
}
//WriteFileʵÏÖÏÂÔØ
protected void Button2_Click(object sender, EventArgs e)
{
/*
using System.IO;
*/
string fileName = "asd.txt";//¿Í»§¶Ë±£´æµÄÎļþÃû
string filePath = Server.MapPath("DownLoad/aaa.txt");//·¾¶
FileInfo fileInfo = new FileInfo(filePath);
Response.Clear();
Response.ClearContent();
Response.ClearHeaders();
Response.AddHeader("Content-Disposition", "attachment;filename=" + fileName);
Response.AddHeader("Content-Length", fileInfo.Lengt
Ïà¹ØÎĵµ£º
Global.asax Îļþ£¬ÓÐʱºò½Ð×ö asp.net Ó¦ÓóÌÐòÎļþ£¬ÌṩÁËÒ»ÖÖÔÚÒ»¸öÖÐÐÄλÖÃÏìÓ¦Ó¦ÓóÌÐò¼¶»òÄ£¿é¼¶Ê¼þµÄ·½·¨¡£Äã¿ÉÒÔʹÓÃÕâ¸öÎļþʵÏÖÓ¦ÓóÌÐò°²È«ÐÔÒÔ¼°ÆäËüһЩÈÎÎñ¡£ÏÂÃæÈÃÎÒÃÇÏêϸ¿´Ò»ÏÂÈçºÎÔÚÓ¦ÓóÌÐò¿ª·¢¹¤×÷ÖÐʹÓÃÕâ¸öÎļþ¡£
¸ÅÊö
Global.asax λÓÚÓ¦ÓóÌÐò¸ùĿ¼Ï¡£ËäÈ» Visual Studio .NET »á×Ô¶¯²åÈëÕ⸠......
ǰ̨´úÂ룺
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="articleview.aspx.cs" Inherits="articleview" %>
<!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"> ......
Õ⼸ÌìÒ»Ö±ÔÚÎ§ÈÆASP.NET MVC½øÐÐѧϰ£¬ËäȻ֮ǰ½Ó´¥ÁËһЩ£¬µ«ÊÇ»¹Ã»ÓÐÕâôϵͳµÄ×ö¹ýÏà¹ØµÄ²âÊÔѧϰ£¬ÔÚ×îºó¶ÔÆä½øÐÐ×ܽᣬϣÍû¶ÔÓÚ³õѧMVCµÄÈ˶¼ÓÐËù°ïÖú¡£
ÏÖÔÚ½«ASP.NET MVCµÄһϵÁÐÎÄÕÂÕûÀíÈçÏ£º
1¡¢¡¾ASP.NETרÌâ¡¿(1)——ASP.NET MVC³õ̽£º
http://blog.csdn.net/rocket5725/archive/2010/01/11/5177 ......
£±¡¢½â¾öCookie¸üÐÂÖͺóµÄÎÊÌâ
¡¡¡¡ÏÈдÈëÒ»¸ö¹ýÆÚµÄCookie£¬ÔÙÌí¼ÓÒ»¸öеÄCookie¾Í£Ï£ËÁË¡£Ê¾Àý´úÂëÈçÏÂËùʾ£º
protected void btnSearch_Click(object sender, EventArgs e)
{
//Éú³ÉÌõ¼þ±í´ïʽ
string where = bll.GetWhereSql(Int32.Parse(ddlCate.SelectedValue),
......
֮ǰд¹ýһϵÁеÄExtJSµÄʹÓý̳̣¬µ«ÊÇ»ù±¾±È½ÏÁãÉ¢£¬±¾ÎÄÖ÷Òª¶ÔÆä½øÐйéÄÉ×ܽᡣϣÍû¶ÔÓÚ³õѧ»òÕ߸´Ï°extjsµÄͬÃËÃÇÓÐËù°ïÖú¡£
ÁбíÇåµ¥ÈçÏÂËùʾ£º
1¡¢ExtJSµÄʹÓ÷½·¨»ã×Ü(1)——ÅäÖúͱí¸ñ¿Ø¼þʹÓà £º
http://blog.csdn.net/rocket5725/archive/2009/09/09/4535323.aspx
2¡¢ExtJSµÄʹÓ÷½·¨»ã×Ü(2)&mdash ......