An open API service indexing awesome lists of open source software.

https://github.com/fkucukkara/razor101

This project serves as a template demonstration of ASP.NET Core Razor Pages, showcasing the fundamental concepts and best practices of Razor Pages development. It's built using .NET 9.0 and follows modern web development patterns.
https://github.com/fkucukkara/razor101

csharp dotnet-core razor-pages template

Last synced: about 2 months ago
JSON representation

This project serves as a template demonstration of ASP.NET Core Razor Pages, showcasing the fundamental concepts and best practices of Razor Pages development. It's built using .NET 9.0 and follows modern web development patterns.

Awesome Lists containing this project

README

          

# Razor101 - ASP.NET Core Razor Pages Sample Project

This project serves as a template demonstration of ASP.NET Core Razor Pages, showcasing the fundamental concepts and best practices of Razor Pages development. It's built using .NET 9.0 and follows modern web development patterns.

## ๐Ÿš€ Features

- Clean and organized Razor Pages project structure
- Bootstrap-based responsive design
- jQuery integration for client-side functionality
- Built-in error handling and privacy pages
- Static file serving (CSS, JavaScript, images)
- Preconfigured development and production settings

## ๐Ÿ› ๏ธ Prerequisites

- [.NET 9.0 SDK](https://dotnet.microsoft.com/download) or later
- Any code editor (recommended: Visual Studio 2022 or Visual Studio Code)

## ๐Ÿ“ฆ Project Structure

```
Razor101/
โ”œโ”€โ”€ Pages/ # Razor Pages and their code-behind files
โ”‚ โ”œโ”€โ”€ Shared/ # Shared layouts and partial views
โ”‚ โ”œโ”€โ”€ _ViewImports.cshtml # Common imports and tag helpers
โ”‚ โ”œโ”€โ”€ _ViewStart.cshtml # Common view configurations
โ”‚ โ”œโ”€โ”€ Error.cshtml # Error handling page
โ”‚ โ”œโ”€โ”€ Index.cshtml # Home page
โ”‚ โ””โ”€โ”€ Privacy.cshtml # Privacy policy page
โ”œโ”€โ”€ wwwroot/ # Static files (CSS, JS, images)
โ”‚ โ”œโ”€โ”€ css/ # Stylesheet files
โ”‚ โ”œโ”€โ”€ js/ # JavaScript files
โ”‚ โ””โ”€โ”€ lib/ # Third-party libraries
โ”œโ”€โ”€ Properties/ # Project properties and launch settings
โ”œโ”€โ”€ appsettings.json # Application settings
โ””โ”€โ”€ Program.cs # Application entry point and configuration
```

## ๐Ÿš€ Getting Started

1. Clone the repository:
```powershell
git clone [repository-url]
cd Razor101
```

2. Restore dependencies:
```powershell
dotnet restore
```

3. Run the application:
```powershell
dotnet run
```

4. Open your browser and navigate to:
```
https://localhost:5001
```

## ๐Ÿ”ง Configuration

The project includes two configuration files:
- `appsettings.json`: Main configuration file
- `appsettings.Development.json`: Development-specific settings

## ๐Ÿงช Features Demonstrated

1. **Razor Pages**: Model-View-ViewModel pattern with code-behind files
2. **Layouts**: Shared layout using `_Layout.cshtml`
3. **Static Files**: Serving static content from wwwroot
4. **Error Handling**: Custom error page implementation
5. **Configuration**: Environment-based settings management
6. **Tag Helpers**: Built-in ASP.NET Core tag helpers usage

## ๐Ÿ”’ Security

- Built-in security features of ASP.NET Core
- HTTPS configuration
- Anti-forgery token validation
- Secure cookie handling

## ๐ŸŽฏ Best Practices Implemented

- Clean separation of concerns
- Proper use of layouts and partial views
- Environment-specific configurations
- Built-in dependency injection
- Proper static file organization

## ๐Ÿ“š Learning Resources

- [Official ASP.NET Core Documentation](https://docs.microsoft.com/en-us/aspnet/core/)
- [Razor Pages Documentation](https://docs.microsoft.com/en-us/aspnet/core/razor-pages/)
- [ASP.NET Core Tutorials](https://docs.microsoft.com/en-us/aspnet/core/tutorials/)

## License
[![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)

This project is licensed under the MIT License. See the [`LICENSE`](LICENSE) file for details.