A modern .NET Core 8.0 MVC application with a responsive user registration form and listing page.
- User Registration Form with comprehensive validation
- User Listing Page with search and filtering capabilities
- Dynamic State/City Cascading based on database data
- Photo Upload with JPG/PNG validation
- Modern UI using Bootstrap 5.3
- Responsive Design for all device sizes
- Database-First Approach with Entity Framework Core
- .NET Core 8.0 with MVC Razor Pages
- Entity Framework Core 8.0
- SQL Server (LocalDB)
- Bootstrap 5.3 for modern UI
- Font Awesome 6.4 for icons
- jQuery for client-side interactions
- Execute the SQL script in
Database/CreateDatabase.sql
to create the database and tables - The script includes sample data for Countries, States, Cities, and Hobbies
- Name: Required, max 25 characters
- Gender: Required (Male/Female radio buttons)
- Date of Birth: Required, date format
- Email: Optional, valid email format if provided
- Contact: Either Mobile or Phone number is required
- State/City: Required, cascading dropdown from database
- Photo: Optional, only JPG/PNG files allowed
- Terms: Required only when all other validations pass
- Real-time client-side validation
- Dynamic city loading based on state selection
- Photo upload with preview
- Conditional terms and conditions validation
- Search by name (case-insensitive, partial match)
- Filter by gender and state
- Pagination (10 records per page)
- Clickable email links in name column
- Photo thumbnails display
GET /api/Location/countries
- Get list of countriesGET /api/Location/states/{countryCode}
- Get states by countryGET /api/Location/cities/{stateCode}
- Get cities by stateGET /User/GetCitiesByState?stateId={id}
- Get cities by state ID (internal)
- Ensure SQL Server LocalDB is installed
- Execute the database creation script
- Run
dotnet build
to build the project - Run
dotnet run
to start the application - Navigate to
https://localhost:5001
orhttp://localhost:5000
MachineForm/
├── Controllers/ # MVC Controllers
├── Models/ # Entity Models and DbContext
├── ViewModels/ # View Models for forms
├── Views/ # Razor Views
├── wwwroot/ # Static files (CSS, JS, uploads)
├── Database/ # SQL scripts
└── appsettings.json # Configuration
- Default route redirects to User Registration form
- Uploaded photos are stored in
wwwroot/uploads/
- Form follows exact specifications from the provided requirements
- All validations match the specified business rules