lundi 18 juillet 2016

How to create indexError in ASP.Net

Wanna create a page informing: Index Not Exist by modifying the codes below in ASP.NET. That is, when NEWs_ID exceeds largest News_ID occurs in my database, display "Index Not Exist" on the page.Don't know how to use if statement more specifically.

<ItemTemplate>
<li style="width:100px;">
<a href="/Promoter.aspx?id=<%#Eval("News_ID") %>" class="link03">
<%# Eval("News_ID") == Request.QueryString["id"] ? "<strong class='text05'>" + Eval("Title").ToString()+"</strong>": Eval("Title").ToString()%>  
</a>
</li>
</ItemTemplate>

Aucun commentaire:

Enregistrer un commentaire