首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Kentico (“DocumentType”)

Kentico (“DocumentType”)
EN

Stack Overflow用户
提问于 2016-11-09 14:51:36
回答 1查看 62关注 0票数 0

这里有什么问题吗?我在试着找一个没有句号的文档类型。

代码语言:javascript
复制
<script runat="server">
  // we need to remove the . from the DocumentType
  
  public string dt;  
  
  protected override void OnDataBinding(EventArgs e){
    dt = Eval("DocumentType").ToString();
    dt = dt.TrimStart('.');
  }
</script>

<li>
  <p class='title'><a href='<%# GetDocumentUrl() %>' target='_blank' class='type-<%# dt %>' data-name='<%# Eval("FileName") %>'><%# Eval("FileName") %></a></p>
  <p class='description'><%# Eval("FileDescription") %></p>
  <a href='<%# GetDocumentUrl() %>' target='_blank' class='btn btn-chevron type-<%# dt %>' data-name='<%# Eval("FileName") %>'>Download</a>
</li>

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2016-11-09 15:07:10

TrimStart只会修剪主角。你需要dt.Replace(".", string.Empty)

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/40509797

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档