zoukankan      html  css  js  c++  java
  • MVC4.0 里的分析器错误

    这种错误有很多,今天碰到了,代码段写在if里就回出错,应该是认冲了吧
                   

    @if (Web.Common.UserInfo.CurrentUserInfo != null)
                    {

            @{Web.ShoppingCart_Get SCG = new Web.ShoppingCart_Get(); string Number = SCG.Goods_ShoppingCart_GetNumber();}
                        <div style=" 118px; height: 32px; position: absolute; margin-top: 35px; margin-left: 882px;
                            z-index: 1;">
                            <a href="~/ShoppingCart/ShoppingCart">
                                <img src="http://images.cnblogs.com/gwc_bg.gif" width="118" height="32" border="0" /></a>
                                @Number
                        </div>
                    }

    下面这么写。

    @{Web.ShoppingCart_Get SCG = new Web.ShoppingCart_Get(); string Number = SCG.Goods_ShoppingCart_GetNumber();}

     @if (Web.Common.UserInfo.CurrentUserInfo != null)
    {       
    <div style=" 118px; height: 32px; position: absolute; margin-top: 35px; margin-left: 882px;
    z-index: 1;">
    <a href="~/ShoppingCart/ShoppingCart">
    <img src="http://images.cnblogs.com/gwc_bg.gif" width="118" height="32" border="0" /></a>
    @Number
    </div>
    }

    或者这么写

                   
                    @if (Web.Common.UserInfo.CurrentUserInfo != null)
                    {
                        Web.ShoppingCart_Get SCG = new TieCan.Web.ShoppingCart_Get(); string Number = SCG.Goods_ShoppingCart_GetNumber();
                        <div style=" 118px; height: 32px; position: absolute; margin-top: 35px; margin-left: 882px;
                            z-index: 1;">
                            <a href="~/ShoppingCart/ShoppingCart">
                                <img src="http://images.cnblogs.com/gwc_bg.gif" width="118" height="32" border="0" /></a>
                                @Number
                        </div>
                    }

  • 相关阅读:
    VUE3 使用 Ant Design Vue 图标库的图标
    Vue3 前端获取数据后 “响应式表示” ref and reactive
    Vue3 使用 生命周期函数
    SpringBoot 前后端分离 跨域小问题
    Vue 使用 Ant Design Vue 。
    SB + Mybatis generator 实现模糊查询 且 过滤数据返回体 + Bean转换
    springboot+mybatis 利用插件生成代码
    spark-sql-03从mysql获取数据上传数据
    spark-sql-02
    sprak-sql-01-基础
  • 原文地址:https://www.cnblogs.com/cuihongyu3503319/p/3148874.html
Copyright © 2011-2022 走看看