<%@ WebHandler Language="C#" Class="Shopping" %>

using System;
using System.Web;
using System.Text;
public class Shopping : IHttpHandler {

    public void ProcessRequest(HttpContext context)
    {
        ProfileCommon Profile = new ProfileCommon();
        string itemId = context.Request.QueryString["addItem"];
        Profile.ShoppingCart.Add(itemId);
        Profile.Save();
        StringBuilder str = new StringBuilder();
        context.Response.ContentType = "text/plain";
        str.Append("<table width='100%' border='0' cellspacing='0' cellpadding='0'>");
        str.Append("<tr style='font-size:12px;height:30px'>");
        str.Append("<td align='center'>购物车共<strong>1</strong>种</td>");
        str.Append("<td align='center'>合计：<strong>312.00</strong></td>");
        str.Append("</tr>");
        str.Append("<tr>");
        str.Append("<td height='5px'></td><td></td>");
        str.Append("</tr>");
        str.Append("<tr>");
        str.Append("<td align='center'><input type='submit' name='button' id='button' value='查看购物车' /></td>");
        str.Append("<td align='center'><input type='button' onclick='javascript:window.parent.closeWithIframe();' name='button2' id='button2' value='继续购买' /></td>");
        str.Append("</tr>");
        str.Append("</table>");
        context.Response.Write(str);
    }
 
    public bool IsReusable {
        get {
            return false;
        }
    }

}