Une autre façon de le mettre en œuvre:
public string nonImage() {
string imgTag = "", Article_OwnerID = "", Article_ID = "", Article_OwnerType = "", imgSrc = "";
DataTable DtArticles = SE_Article.GetArticlesList(UserID, UserID, ProfileType, CounterOfPage, CountPerPage, (short) SE_Action.OwnerType.user, SE_Security.CheckInjection(TxtSearch.Text.Trim()), CategoryID, "all_articles", DrpOrderBy.SelectedValue, DrpSort.SelectedValue);
if (DtArticles != null && DtArticles.Rows.Count > 0) {
Article_OwnerID = DtArticles.Rows[0]["Article_OwnerID"].ToString();
Article_ID = DtArticles.Rows[0]["Article_ID"].ToString();
Article_OwnerType = DtArticles.Rows[0]["Article_OwnerType"].ToString();
}
if (SE_Article.GetArticleCover(Convert.ToInt32(Article_OwnerID), Convert.ToInt32(Article_ID), Convert.ToInt16(Article_OwnerType)) != System.Configuration.ConfigurationManager.AppSettings["NoPhotoArticleThumb"]) {
imgSrc = SE_Article.GetArticleCover(Convert.ToInt32(Article_OwnerID), Convert.ToInt32(Article_ID), Convert.ToInt16(Article_OwnerType));
imgTag = "";
}
return imgTag;
}
<% nonImage(); %>