ASP.NETÊý¾Ý¿âµ¼ÈëExcel
StringWriter sw = new StringWriter();
sw.WriteLine("·ÃÎʹºÂòÂÊ");
sw.WriteLine("ÅÅÐÐ\tÉÌÆ·Ãû³Æ\tÈËÆøÖ¸Êý\t¹ºÂò´ÎÊý\t·ÃÎʹºÂòÂÊ");
int i = 0;
foreach (ProductSaleInfo productSale in productSaleList)
{
i = i + 1;
sw.WriteLine(i.ToString() + "\t" + productSale.Name.ToString() + "\t" + productSale.ViewCount.ToString() + "\t" + productSale.SaleCount.ToString() + "\t" + XWXCommon.ProductBuyRate(productSale.ViewCount.ToString(), productSale.SaleCount.ToString()));
}
sw.Close();
Response.Clear();
Response.Buffer = true;
Response.Charset = "GB2312";
Response.AppendHeader("Content-Disposition&
Ïà¹ØÎĵµ£º
×î½ü¿ª·¢ÖÐÔÚÒ³ÃæÖ®¼ä´«µÝÖµµÄ¹ý³ÌÖУ¬¶à´¦Ó¦ÓÃÁ˳¬Á´½Ó´«ÖµµÄ·½Ê½¡£µ«Êǵ±´«µÝµÄ²ÎÊýÖк¬ÓÐÖÐÎÄ×Ö·ûʱ£¬ÔÚµ÷ÓÃRequest.QueryString[]·½·¨½ÓÊÕ²ÎÊýʱ£¬×ÜÊdzöÏÖ´íÎ󣬶øÇÒ´íÎóµÄ³öÏÖ×ÜÊÇËæ»úµÄ¡£±íÏÖΪ½ÓÊÕµÄÖÐÎIJÎÊý²»È«£¬ºó¼ÓͨÅä·û“£¿”£¬»òÕß°ÑÖÐÎIJÎÊýºóµÄÄǸö²ÎÊýºÍÖÐÎIJÎÊý»ìÔÚÒ»Æð£¬²»¼ÓÇø·Ö¡£
& ......
±¾ÏµÁÐÎÄÕ»ùÓÚASP.NET MVC Preview5.
viewÔÚMVCģʽÖÐÓëÓû§½øÐÐ×îÖ±½ÓµÄ½Ó´¥£¬Ëü¸ºÔðÊý¾ÝµÄ³ÊÏÖ¡£ÕâÀïҪעÒâÒ»µã¾ÍÊÇ£¬viewÖ»ÊǸºÔðÊý¾ÝµÄ³ÊÏÖ£¬ËùÒÔÎÒÃÇÓ¦¸ÃÒª¾¡Á¿ÈÃ
viewÖв»Éæ¼°ÒµÎñÂß¼µÄ´¦Àí¡£
ÎÒÃÇÀ´Ìí¼ÓÒ»¸öBlogÊ×Ò³µÄview¡£ÔÚ°²×°ÁËASP.NET MVCºó£¬ÎÒÃÇÔÚÌí¼ÓÐÂÏîÄ¿µÄʱºò¿ÉÒÔ¿´µ½ÓÐMVCµÄviewÄ£°å£º
......
ÕâÀïÊÇÎÒµÄÒ»¸ö¼òµ¥µÄjquery+jsonµÄÁ¬¿â²Ù×÷£¬Ö»ÊÇÒ»¸ö¼òµ¥²éѯ£¬
//ºǫ́´úÂë
<%@ WebHandler Language="C#" Class="show" %>
using System;
using System.Web;
using System.Collections.Generic;
using Model;
using DAL;
using System.Web.Script.Serialization;
public class show ......
ʼþÄ£ÐÍ
µ±Ä³¸öÒ³Ãæ±»ÇëÇóʱ£¬ËüµÄÀ༰ÆäËù°üº¬µÄ·þÎñÆ÷¿Ø¼þ»á¸ºÔð´¦ÀíÇëÇ󣬳ÊÏÖHTMLÊä³ö£¬²¢Ëæºó·¢»Ø¿Í»§¶Ë¡£ÓÉÓÚHTTPÐÒéµÄ¹ÌÓÐÌØÐÔ£¬¿Í»§¶ËÓë·þÎñÆ÷¼äµÄͨÐÅÊÇÎÞ״̬ÇÒ·ÇÁ¬½ÓµÄ¡£¶øÊµ¼ÊµÄÓ¦ÓóÌÐòÐèҪ״̬£¬ÒÔ±ãά»¤¶ÔÍ¬Ò»Ò³ÃæµÄºóÐøµ÷Óá£Ê¹ÓÃASP»òÆäËû·þÎñÆ÷¶Ë¿ª·¢Æ½Ì¨(ÈçJava Server PageºÍLAMPÒ»ÀàµÄ»ùÓÚLinuxµÄÏ ......
1.ͨ¹ýRewritePathʵÏÖÖØÐ´
URLÖØÐ´¿ÉÒÔͨ¹ý±à³ÌµÄ·½Ê½À´ÊµÏÖ¡£ASP.NETÖеÄContex.RewritePath()·½·¨¿ÉÒÔÈÃÄã´Ó³ÌÐòÖÐʵÏÖÖØÐ´ÇëÇóµÄURL¡£Ò»µ©ÖØÐ´ºó£¬ÏµÍ³½«Ê¹ÓÃеķ¾¶À´¼ÌÐøÖ´ÐÐÕâ¸öÇëÇó¡£
ÔÚGlobal.asaxÎļþµÄApplication_BeginRequest()·½·¨ÖУ¬ÄãÐèÒªÔö¼Ó´úÂëÀ ......