Hi i hope someone can help me, Im new to ASP and c# and am a little bit lost. I currently am giving an existing website a new html face lift, i have come accross a problem when it comes to an repeater within the code. Currently on the site there is a trending videos section and they are all ranked from 1 too 10. The way this is currently handled is is by returning a row_number from the database and then ordering the videos by that as can be seen below.
CAST(ROW_NUMBER() OVER(ORDER BY totals DESC) AS CHAR(4)) xRank
using (SqlDataAdapter sdaTrendingV2017 = new SqlDataAdapter(cmdTrendingV2017))
{
DataTable dtTrendingV2017 = new DataTable();
sdaTrendingV2017.Fill(dtTrendingV2017);
rptTrending.DataSource = dtTrendingV2017;
rptTrending.DataBind();
}
This is then displayed in this current repeater
<asp:Repeater ID="rptTrending" runat="server" OnItemDataBound="ItemBound">
<ItemTemplate>
<!-- START - Trending Article -->
<div class="column medium-6">
<article class="matchHeight">
<a href="/<%# Eval("trendChannelDirectory").ToString() %>/<%# Eval("trendChannelCategoryDirectory").ToString() %>/<%# Eval("trendURL").ToString() %>">
<div class="img-container" style="background-image:url('<%# PicturePath("/uploads/" + Eval("trendType") + "/" + Eval("trendRes") + "/" + Eval("trendImage"), "/uploads/news/image-unavailable/image-unavailable-310x176.jpg") %>')">
</div>
<div class="rank"><%#Eval("xRank")%></div>
<div class="trendTitle">
<%# Eval("trendTitle").ToString() %><br /><br />
<div class="article-type <%# Eval("trendTypeText").ToString().ToLower() %>">
<span><%# Eval("trendTypeText").ToString().ToUpper() %><i></i></span>
</div>
</div>
</a>
</article>
</div>
<!-- END - Trending Article -->
</ItemTemplate>
What i need to happen instead of the repeater returning the numbers 1,2,3,4 etc on each story in the repeater i need it to the return One, Two, Three etc. I cannot figure out the best way to do to this. Can anyone explain what i would need to do in order to fix this issue? Any help appreciated