2007.08.24 C#工作随笔

ShoppingCart.aspx
   <script language="c#" runat="server">
      static int i;
      static int d=1;
      static int n;
      
      void typeid()
       {
         String type=Request.Params["type"];       
         Response.Write(type);
         while((i<n)||(i==0))
           {i++;} 
         Response.Write(i);
         Response.Write("&nbsp;");
         Session["id"+i]=Request.Params["type"];
         Response.Write("&nbsp;");
         Response.Write(Session["id"+i]);
         n=i; 
       }
      void type()
      {
        String type=Request.Params["type"];       
        Response.Write(type);
      }
 
      void list()
       { Response.Write(Session["id"+d]);
         d++;
       }
 
      void clear()
       {
        while(n>=0)
         {Session.Remove("id"+n);
          n--;}
        i=0;
        n=0;
       }
</script>
 
在中间列表中加了一列:
<TD width="60px"><b>Type</b></TD>
<TD width="60px"><%//#Container.ItemIndex+1%>&nbsp;<%list();%></TD>

原文地址:https://www.cnblogs.com/limshirley/p/1498527.html