@model IEnumerable @{ ViewBag.Title = "آخرین اخبار"; }

@ViewBag.Title


@if (!Model.Any()) {

در حال حاضر خبری برای نمایش وجود ندارد.

} else { foreach (var item in Model) {
@item.News_Title
@item.News_Title

@item.News_Summary

@* --- New section for Category and Tags --- *@
@if (!string.IsNullOrEmpty(item.News_Category)) {
دسته بندی: @* --- FIXED: Loop through categories to create separate badges --- *@ @{ var categories = item.News_Category.Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries); foreach (var category in categories) { @category.Trim() } }
} @if (!string.IsNullOrEmpty(item.News_Tag)) {
تگ ها: @{ var tags = item.News_Tag.Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries); foreach (var tag in tags) { @tag.Trim() } }
}
@**@
} }