模型属性用ASP.NET MVC替换空间 [英] Model properties replace space with &nbsp ASP.NET MVC

查看:72
本文介绍了模型属性用ASP.NET MVC替换空间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我输入fa fa-pencil-square-o代码时,它工作正常

,但当我使用像 [__ i class =@ Model [i] .Icon__] 我检查时图标正在消失,显示为fanbspfa-pencil-square-o



我尝试过:



  @ model 列表与LT; muksab.models.aboutmodel> 
@ {
布局= null ;
}
@ for int j = 0 ; j < = Model.Count(); j ++)
{
< div class = row >
@ for int i = 0 ; i < = 3 ; i ++)
{
if(j < = Model.Count() )

< span class =code-attribute> {

< div class = col-lg- 3 col-md-3 col-sm-6 >
< div class = single-about-content >
< div class = icon round-border tran3s >
[__ i class = @ Model [i] .Icon __]

< / div >
< h5 > < a href = class = tran3s > @ Model [i] .Services < span class =code-keyword>< / a > < / H5>
< p > @ Model [i] .ServicesDescr < / p >
< a href = class = more tran3s hvr-bounce-to-right > 更多详情< / a >
< / div >
< / div >

j ++;
}
}
< / div >
}

解决方案

尝试



 [__ i class =@ Html.Raw(Model [i] .Icon)__] 


< blockquote>这是复制过去的问题。当我键入它工作正常,但当我复制过去它不工作,我不是为什么。


when i type "fa fa-pencil-square-o" code it works fine
, but when i use like [__i class="@Model[i].Icon"__] the icon is disappearing when i inspect it is showing like "fanbspfa-pencil-square-o"

What I have tried:

@model List<muksab.models.aboutmodel>
@{
    Layout = null;
}
@for (int j = 0; j <= Model.Count(); j++)
{
    <div class="row">
        @for (int i = 0; i <= 3; i++)
        {
            if (j <= Model.Count())

            {

                <div class="col-lg-3 col-md-3 col-sm-6">
                    <div class="single-about-content">
                        <div class="icon round-border tran3s">
                            [__i class="@Model[i].Icon"__]

                        </div>
                        <h5><a href="#" class="tran3s">@Model[i].Services</a></h5>
                        <p>@Model[i].ServicesDescr</p>
                        <a href="#" class="more tran3s hvr-bounce-to-right">More Details</a>
                    </div>
                </div>

                j++;
            }
        }
    </div>
}

解决方案

Try

[__i class="@Html.Raw(Model[i].Icon)"__]


it was the problem of copy past.when i type it is working fine but when i do copy past it is not working, i don't why.


这篇关于模型属性用ASP.NET MVC替换空间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆