Reputation: 1256
Is there anything that could be a problem here? I'm trying to get a document type, with out the period.
<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>
Upvotes: 0
Views: 68
Reputation: 4325
TrimStart
will only trim leading characters. You need dt.Replace(".", string.Empty)
.
Upvotes: 1