zoukankan      html  css  js  c++  java
  • 网上商城设计

    1,购物车实现:

       页面:

       代码:

       数据:

    购物车数据可以保存在Profile中,Profile跟Session类似,不过Profile是强类型。

    a,配置Profile ,只能在网站根目录或者machine.config中定义Profile,一个应用程序中无法定义两个以上的Profile。

    <configuration>

      <System.web>

          <profile>

             <propertie>

                 <add name=”UserName” defaultValue=”song” allowAnonymous=”true” />

                 <add name=”Address”  defaultValue=”changchun” allowAnonymous=”true” />

              </propertie>

          </profile>

       </system.web>

    <configuration>

          b,使用Profile:

       更新值:

    Page_Load()
    {
    	profile.username="aa";
    	profile.address="bb";     //这样就会自动将值保存到Profile中。
    }
      使用值:
    void btn1_click(object sender, eventargs e)
    {
        lblshow.text=Profile.username;       //获取值
    }
  • 相关阅读:
    C语言实现快排
    C语言实现双向循环链表
    mysql插入数据后返回自增ID的方法
    golang flag包简单例子
    练习题 (六)
    练习题 (五)
    练习题 (四)
    练习题 (三)
    练习题 (二)
    练习题 (一)
  • 原文地址:https://www.cnblogs.com/netact/p/1959807.html
Copyright © 2011-2022 走看看