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

  • 相关阅读:
    logging 用于便捷记录日志且线程安全的模块
    win10安装多个mysql实例
    Windows安装mysql-msi
    webAPI解决跨域问题
    net core通过中间件防御Xss
    导出excel
    DES加密/解密类
    MySQL优化配置
    上传文件到服务器
    HttpWebRequest调用接口
  • 原文地址:https://www.cnblogs.com/cuihongyu3503319/p/3148874.html
Copyright © 2011-2022 走看看