Hello Team,
Currently I am working in development project and I am trying to load in page load dropdown and texbox in the same .Cshtml page.
But to call two action methods in the same view.cshml , I have texbox other details I am using one action method and other dropdown I am using another action method calling to laod from DB.
1. public IActionResult Index(H1BOptionDetails H1Bdetails)(textbox data loading using this action method)
2.public async Task
Muhammad Imran AnsariPosted Jun 3, 2025, 7:46 AM
In ASP.NET Core MVC, you cannot directly call two action methods from a single
action. However, you can load data for both the textbox and dropdown in a single action method (typically theIndexaction) and bind them in the view.The recommended approach is to use a ViewModel and combine both data loads in one action:
Good Luck!
Amit MohantyPosted Jun 3, 2025, 5:30 AM
With a .cshtml Razor view, you cannot directly call two action methods from a single