Guest User

Guest User

  • Tech Writer
  • 103
  • 13.3k

Set Particular Id li click.

May 5 2021 5:34 PM
How to send li id click li (Particular id).This is my .cshtml code
<h3 id="BlogCategories">Blog Categories</h3>
<ul class="list-group--alt">
@foreach (var category in Model)
{
<li id="@category.CategoryId"><a href="/[email protected]">@category.Title</a></li>
}
 
 This is my .cs file code(not it's component not controller and not send id by query string)
 
private async Task<PagedQueryResult<BlogPostSummary>> MapBlogPostsAsync(PagedQueryResult<CustomEntityRenderSummary> customEntityResult)
{
var blogPosts = new List<BlogPostSummary>(customEntityResult.Items.Count());
var imageAssetIds = customEntityResult
.Items
.Select(i => (BlogPostDataModel)i.Model)
.Select(m => m.ThumbnailImageAssetId)
.Distinct();
//string Categoryid = HttpContext.Request.Query["CatgeoryId"].SingleOrDefault();
var Categoryid = customEntityResult.Items.Select(x => (BlogPostDataModel)x.Model).Select(x => x.CategoryIds).FirstOrDefault();
 }