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>
                    }

  • 相关阅读:
    【题解】Luogu p2016 战略游戏 (最小点覆盖)
    【模板】Linux下输出文件的对比
    【题解】Luogu P3052 【USACO12】摩天大楼里的奶牛Cows in a Skyscraper
    【题解】滑雪 luogu1434 记忆化搜索
    【题解】Luogu P3110 [USACO14DEC]驮运Piggy Back
    【题解】Luogu P3123 [USACO15OPEN]贝茜说哞Bessie Goes Moo
    【题解】Luogu P2214 [USACO14MAR]哞哞哞Mooo Moo
    【题解】Luogu P2327 [SCOI2005]扫雷
    【题解】Luogu P1011 车站
    【题解】Luogu P2889 [USACO07NOV]挤奶的时间Milking Time
  • 原文地址:https://www.cnblogs.com/cuihongyu3503319/p/3148874.html
Copyright © 2011-2022 走看看