Open Closed

<asp-select> within Advanced filter #7062


User avatar
0
nabass created

hi sir i faced a problem with making a select into advanced filter i made a page using suite by default it creates an index page with advance filter i want some of field no to be just input no i want it select option here is my steps and the final result

  • ABP Framework version: v8
  • UI Type: MVC
  • Database System: EF Core (SQL Server)
Markdown supported.
Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)

1 Answer(s)
  • User Avatar
    0
    nabass created

    i solved it thank you if any one faced the same problem here is the solution -- make like CreateModel page syntax example: into class (Index.cs) public abstract class IndexModelBase : AbpPageModel { [BindProperty] public JournalVoucheraIndexViewModel JV { get; set; } public List<SelectListItem> CurrencyIdFilterMin { get; set; } = new List<SelectListItem> { new SelectListItem("-",null) }; private readonly ICurrencyAppService _currencyAppService; public IndexModelBase(ICurrencyAppService currencyAppService) { _currencyAppService = currencyAppService; }

     public virtual async Task OnGetAsync()
     {
         CurrencyIdFilterMin.AddRange((
                       await _currencyAppService.GetCurrencyLookupAsync(new LookupRequestDto
                       {
                           MaxResultCount = LimitedResultRequestDto.MaxMaxResultCount
                       })).Items.Select(t => new SelectListItem(t.DisplayName, t.Id.ToString())).ToList()
           );
     public class JournalVoucheraIndexViewModel : JournalVoucherDto
     {
    
     }
    

    }

    ====================== into (index.cshtml) <abp-select asp-for="JV.CurrencyId" asp-items="Model.CurrencyIdFilterMin" label="@L["MinCurrencyId"].Value" />

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.8.0-preview. Updated on September 28, 2026, 11:44
1
ABP Assistant
🔐 You need to be logged in to use the chatbot. Please log in first.