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;       //获取值
    }
  • 相关阅读:
    大屏展示功能
    单例模式/原型模式
    .net core ioc
    Log4net
    mvc 过滤器
    webservice
    页面传值 作用域
    Map使用方法
    java获取当前时间撮
    linux 下统计文本行数的各种方法(一)
  • 原文地址:https://www.cnblogs.com/netact/p/1959807.html
Copyright © 2011-2022 走看看