Every professional web application needs a well-designed error page. Rather than showing a plain "404 - Page Not Found" message, why not enhance the user experience with style and structure?
In this blog post, I will share two unique custom 404 error pages built using ASP.NET Web Forms, HTML/CSS, Google Fonts, and animations. Let’s explore both designs and their full implementation.
Error Page Demo 1 Clean & Professional Design with Bootstrap
This version is clean, minimalistic, and user-friendly. It's designed with Bootstrap 5 and the Poppins font for a corporate feel.
Key Features
- Responsive layout using Bootstrap 5
- Smooth bounce animation for the error code
- Linear gradient background for a soft visual tone
- CTA button to redirect users to the Dashboard
Full Code
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ErrorPage-Demo1.aspx.cs" Inherits="TaskPractices.ErrorPage.ErrorPage_Demo1" %>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Error - Page Not Found</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Bootstrap 5 CDN -->
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet">
<!-- Google Font -->
<link href="https://fonts.googleapis.com/css2?family=Poppins:wght@600&display=swap" rel="stylesheet">
<style>
body {
font-family: 'Poppins', sans-serif;
background: linear-gradient(to right, #e3f2fd, #fce4ec);
color: #333;
height: 100vh;
margin: 0;
display: flex;
align-items: center;
justify-content: center;
}
.error-container {
text-align: center;
}
.error-code {
font-size: 8rem;
font-weight: bold;
color: #d32f2f;
animation: bounce 1s infinite alternate;
}
.error-message {
font-size: 1.5rem;
margin-top: 1rem;
}
.error-description {
margin-top: 0.5rem;
font-size: 1rem;
color: #555;
}
.btn-home {
margin-top: 2rem;
background-color: #1976d2;
color: white;
border: none;
padding: 10px 20px;
border-radius: 8px;
text-decoration: none;
}
.homebtn {
margin-top: 50px;
}
.btn-home:hover {
background-color: #0d47a1;
}
@keyframes bounce {
from {
transform: translateY(0px);
}
to {
transform: translateY(-20px);
}
}
</style>
</head>
<body>
<div class="error-container">
<div class="error-code">404</div>
<div class="error-message">Oops! Page Not Found</div>
<div class="error-description">
The page you're looking for doesn't exist or was moved.<br>
Let's get you back to something useful.
</div>
<div class="homebtn">
<a href="../Dashboard.aspx" class="btn-home">Go to Homepage</a>
</div>
</div>
</body>
</html>



Sanjay JoshiPosted May 2, 2025, 5:55 AM
Thanks it's basic page it would needed for 1st time setup of 404 page