如何在Razor帮助器方法中包含不间断的空间(& nbsp;)?这是有问题的帮手:
@helper RenderClipResult(Clip clip,IList<string> searchTerms) { <div class="result"> <!-- other clip stuff --> @if (clip.ThirdPartyMaterials != null && clip.ThirdPartyMaterials.Count > 0) { <p> <span class="heading">Third Party Material</span><br/> @foreach (var material in clip.ThirdPartyMaterials) { @AddElement("Description",material.Description,searchTerms) @AddElement("Cost",material.Cost,searchTerms) <br /> } </p> } </div> }
AddElement是另一个自定义帮助器.我正在寻找的输出是这样的:
Third Party Material first entry second entry third entry
我可以将一个span标签中的AddElement行包装成样式,但它是另一个html标签和CSS规则,只是为了以单个字符宽度缩进一些文本.由于剃刀不能解析空间,可能要这样做
解决方法
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。