How To Populate A State List With Country Dropdown In Pega

admin
How To Populate A State List With Country Dropdown In Pega Rating: 4,4/5 3034 votes

Today, in this article, I will explain how to create a cascading dropdown list using MVC, Web API, and jQuery. Here, I am using three tables - Country, State, and City - respectively. If we select a country, then it should display country related states and when we select a state, it should display state-related cities. Finally, here, we will use MVC, Web, jQuery, and SQL Server. So now, let us see the required steps.Step 1We have to create three tables - Country, State, and City.Step2Now, we need to create an MVC application but we will create two projects here - one is Web API project for the creation of service and the other one is MVC project for consuming that service.

  1. State List Of Indian Constitution

So now, let us add the first MVC project.Open Visual Studio and go to File-New -Web application -select MVC -OK.Step 3Now, add tables in web API project using Entity Framework. So for this, go to Models folder -right-click - Add - New item - ADO.NET Entity Data Model - click Add - select database first approach-click Next.Select 'New Connection' and give the connection details, then select database - click OK.Choose tables and click OK.Step 4Now, we will write the logic for binding the Country, State and City, So, I create a folder Business Logic and take a class CascadingLogic.cs and write the logic. Cascading Dropdown List of Country, State and City.

How

Country Name. State Name. City Name.

AbbreviationState list abbreviation

State List Of Indian Constitution

Output DesignNow, write the jQuery code for consuming and binding the details.