Skip to content

Commit 3a3a389

Browse files
Merge pull request #1 from Backiaraj/common
Modified the readme content
2 parents ef46d1b + 5234369 commit 3a3a389

40 files changed

+484
-1568
lines changed

App.razor

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
2-
<Router AppAssembly="@typeof(Program).Assembly">
3-
<Found Context="routeData">
4-
<RouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)" />
5-
</Found>
6-
<NotFound>
7-
<LayoutView Layout="@typeof(MainLayout)">
8-
<p>Sorry, there's nothing at this address.</p>
9-
</LayoutView>
10-
</NotFound>
11-
</Router>
1+
<Router AppAssembly="@typeof(App).Assembly">
2+
<Found Context="routeData">
3+
<RouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)" />
4+
<FocusOnNavigate RouteData="@routeData" Selector="h1" />
5+
</Found>
6+
<NotFound>
7+
<PageTitle>Not found</PageTitle>
8+
<LayoutView Layout="@typeof(MainLayout)">
9+
<p role="alert">Sorry, there's nothing at this address.</p>
10+
</LayoutView>
11+
</NotFound>
12+
</Router>

Blazor_EditForm.csproj

Lines changed: 0 additions & 11 deletions
This file was deleted.

Data/EmployeeDetails.cs

Lines changed: 77 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -1,77 +1,77 @@
1-
using System;
2-
using System.Collections.Generic;
3-
using System.Text;
4-
using System.ComponentModel.DataAnnotations;
5-
using System.Runtime.CompilerServices;
6-
7-
namespace Blazor_EditForm.Data
8-
{
9-
/// <summary>
10-
/// Get the employee details
11-
/// </summary>
12-
public class EmployeeDetails
13-
{
14-
[Required]
15-
public string FirstName { get; set; }
16-
public string LastName { get; set; }
17-
[Required]
18-
[DataType(DataType.EmailAddress)]
19-
[EmailAddress]
20-
public string Email { get; set; }
21-
public string Gender { get; set; } = "male";
22-
[Required]
23-
[DataType(DataType.PhoneNumber)]
24-
[Phone]
25-
public string PhoneNumber { get; set; }
26-
[Required]
27-
public DateTime? DOB { get; set; }
28-
[Required]
29-
public string Country { get; set; }
30-
[Required]
31-
public string City { get; set; }
32-
[Required]
33-
public string Address { get; set; }
34-
[Required]
35-
[Range(0, 20, ErrorMessage = "The Experience range should be 0 to 20")]
36-
public decimal? TotalExperience { get; set; }
37-
}
38-
39-
public class Countries
40-
{
41-
public string Name { get; set; }
42-
public string Code { get; set; }
43-
44-
public List<Countries> GetCountries()
45-
{
46-
List<Countries> Country = new List<Countries>
47-
{
48-
new Countries() { Name = "Australia", Code = "AU" },
49-
new Countries() { Name = "United Kingdom", Code = "UK" },
50-
new Countries() { Name = "United States", Code = "US" },
51-
};
52-
return Country;
53-
}
54-
}
55-
public class Cities
56-
{
57-
public string Name { get; set; }
58-
public string Code { get; set; }
59-
public string CountryCode { get; set; }
60-
public List<Cities> GetCities()
61-
{
62-
List<Cities> CityName = new List<Cities>
63-
{
64-
new Cities() { Name = "New York", CountryCode = "US", Code="US-101" },
65-
new Cities() { Name = "Virginia", CountryCode = "US", Code="US-102" },
66-
new Cities() { Name = "Washington", CountryCode = "US", Code="US-103" },
67-
new Cities() { Name = "Victoria", CountryCode = "AU", Code="AU-101" },
68-
new Cities() { Name = "Tasmania", CountryCode = "AU", Code="AU-102" },
69-
new Cities() { Name = "Queensland", CountryCode = "AU", Code="AU-103" },
70-
new Cities() { Name = "London", CountryCode = "UK", Code="UK-101" },
71-
new Cities() { Name = "Manchester", CountryCode = "UK", Code="UK-102" },
72-
new Cities() { Name = "Ashford", CountryCode = "UK", Code="UK-103" }
73-
};
74-
return CityName;
75-
}
76-
}
77-
}
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Text;
4+
using System.ComponentModel.DataAnnotations;
5+
using System.Runtime.CompilerServices;
6+
7+
namespace EditFormValidation.Data
8+
{
9+
/// <summary>
10+
/// Get the employee details
11+
/// </summary>
12+
public class EmployeeDetails
13+
{
14+
[Required]
15+
public string FirstName { get; set; }
16+
public string LastName { get; set; }
17+
[Required]
18+
[DataType(DataType.EmailAddress)]
19+
[EmailAddress]
20+
public string Email { get; set; }
21+
public string Gender { get; set; } = "male";
22+
[Required]
23+
[DataType(DataType.PhoneNumber)]
24+
[Phone]
25+
public string PhoneNumber { get; set; }
26+
[Required]
27+
public DateTime? DOB { get; set; }
28+
[Required]
29+
public string Country { get; set; }
30+
[Required]
31+
public string City { get; set; }
32+
[Required]
33+
public string Address { get; set; }
34+
[Required]
35+
[Range(0, 20, ErrorMessage = "The Experience range should be 0 to 20")]
36+
public decimal? TotalExperience { get; set; }
37+
}
38+
39+
public class Countries
40+
{
41+
public string Name { get; set; }
42+
public string Code { get; set; }
43+
44+
public List<Countries> GetCountries()
45+
{
46+
List<Countries> Country = new List<Countries>
47+
{
48+
new Countries() { Name = "Australia", Code = "AU" },
49+
new Countries() { Name = "United Kingdom", Code = "UK" },
50+
new Countries() { Name = "United States", Code = "US" },
51+
};
52+
return Country;
53+
}
54+
}
55+
public class Cities
56+
{
57+
public string Name { get; set; }
58+
public string Code { get; set; }
59+
public string CountryCode { get; set; }
60+
public List<Cities> GetCities()
61+
{
62+
List<Cities> CityName = new List<Cities>
63+
{
64+
new Cities() { Name = "New York", CountryCode = "US", Code="US-101" },
65+
new Cities() { Name = "Virginia", CountryCode = "US", Code="US-102" },
66+
new Cities() { Name = "Washington", CountryCode = "US", Code="US-103" },
67+
new Cities() { Name = "Victoria", CountryCode = "AU", Code="AU-101" },
68+
new Cities() { Name = "Tasmania", CountryCode = "AU", Code="AU-102" },
69+
new Cities() { Name = "Queensland", CountryCode = "AU", Code="AU-103" },
70+
new Cities() { Name = "London", CountryCode = "UK", Code="UK-101" },
71+
new Cities() { Name = "Manchester", CountryCode = "UK", Code="UK-102" },
72+
new Cities() { Name = "Ashford", CountryCode = "UK", Code="UK-103" }
73+
};
74+
return CityName;
75+
}
76+
}
77+
}

Data/WeatherForecast.cs

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
1-
using System;
2-
3-
namespace Blazor_EditForm.Data
4-
{
5-
public class WeatherForecast
6-
{
7-
public DateTime Date { get; set; }
8-
9-
public int TemperatureC { get; set; }
10-
11-
public int TemperatureF => 32 + (int)(TemperatureC / 0.5556);
12-
13-
public string Summary { get; set; }
14-
}
15-
}
1+
namespace EditFormValidation.Data
2+
{
3+
public class WeatherForecast
4+
{
5+
public DateOnly Date { get; set; }
6+
7+
public int TemperatureC { get; set; }
8+
9+
public int TemperatureF => 32 + (int)(TemperatureC / 0.5556);
10+
11+
public string? Summary { get; set; }
12+
}
13+
}

Data/WeatherForecastService.cs

Lines changed: 20 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,20 @@
1-
using System;
2-
using System.Linq;
3-
using System.Threading.Tasks;
4-
5-
namespace Blazor_EditForm.Data
6-
{
7-
public class WeatherForecastService
8-
{
9-
private static readonly string[] Summaries = new[]
10-
{
11-
"Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching"
12-
};
13-
14-
public Task<WeatherForecast[]> GetForecastAsync(DateTime startDate)
15-
{
16-
var rng = new Random();
17-
return Task.FromResult(Enumerable.Range(1, 5).Select(index => new WeatherForecast
18-
{
19-
Date = startDate.AddDays(index),
20-
TemperatureC = rng.Next(-20, 55),
21-
Summary = Summaries[rng.Next(Summaries.Length)]
22-
}).ToArray());
23-
}
24-
}
25-
}
1+
namespace EditFormValidation.Data
2+
{
3+
public class WeatherForecastService
4+
{
5+
private static readonly string[] Summaries = new[]
6+
{
7+
"Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching"
8+
};
9+
10+
public Task<WeatherForecast[]> GetForecastAsync(DateOnly startDate)
11+
{
12+
return Task.FromResult(Enumerable.Range(1, 5).Select(index => new WeatherForecast
13+
{
14+
Date = startDate.AddDays(index),
15+
TemperatureC = Random.Shared.Next(-20, 55),
16+
Summary = Summaries[Random.Shared.Next(Summaries.Length)]
17+
}).ToArray());
18+
}
19+
}
20+
}

EditFormValidation.csproj

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<Project Sdk="Microsoft.NET.Sdk.Web">
2+
3+
<PropertyGroup>
4+
<TargetFramework>net7.0</TargetFramework>
5+
<Nullable>enable</Nullable>
6+
<ImplicitUsings>enable</ImplicitUsings>
7+
</PropertyGroup>
8+
9+
<ItemGroup>
10+
<PackageReference Include="Syncfusion.Blazor.Buttons" Version="22.2.12" />
11+
<PackageReference Include="Syncfusion.Blazor.Calendars" Version="22.2.12" />
12+
<PackageReference Include="Syncfusion.Blazor.DropDowns" Version="22.2.12" />
13+
<PackageReference Include="Syncfusion.Blazor.Inputs" Version="22.2.12" />
14+
<PackageReference Include="Syncfusion.Blazor.Themes" Version="22.2.12" />
15+
</ItemGroup>
16+
17+
</Project>
Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
1-
2-
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio Version 16
4-
VisualStudioVersion = 16.0.29521.150
5-
MinimumVisualStudioVersion = 10.0.40219.1
6-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Blazor_EditForm", "Blazor_EditForm.csproj", "{70A8F420-9C60-4ACA-A43D-0C73F1FBBD77}"
7-
EndProject
8-
Global
9-
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10-
Debug|Any CPU = Debug|Any CPU
11-
Release|Any CPU = Release|Any CPU
12-
EndGlobalSection
13-
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14-
{70A8F420-9C60-4ACA-A43D-0C73F1FBBD77}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15-
{70A8F420-9C60-4ACA-A43D-0C73F1FBBD77}.Debug|Any CPU.Build.0 = Debug|Any CPU
16-
{70A8F420-9C60-4ACA-A43D-0C73F1FBBD77}.Release|Any CPU.ActiveCfg = Release|Any CPU
17-
{70A8F420-9C60-4ACA-A43D-0C73F1FBBD77}.Release|Any CPU.Build.0 = Release|Any CPU
18-
EndGlobalSection
19-
GlobalSection(SolutionProperties) = preSolution
20-
HideSolutionNode = FALSE
21-
EndGlobalSection
22-
GlobalSection(ExtensibilityGlobals) = postSolution
23-
SolutionGuid = {3CA0B867-5E59-4C3E-8B5E-E720316C2750}
24-
EndGlobalSection
25-
EndGlobal
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.4.33213.308
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EditFormValidation", "EditFormValidation.csproj", "{C9311E11-9C36-47CF-9E1D-E6048C1ABC3E}"
7+
EndProject
8+
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|Any CPU = Debug|Any CPU
11+
Release|Any CPU = Release|Any CPU
12+
EndGlobalSection
13+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14+
{C9311E11-9C36-47CF-9E1D-E6048C1ABC3E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{C9311E11-9C36-47CF-9E1D-E6048C1ABC3E}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{C9311E11-9C36-47CF-9E1D-E6048C1ABC3E}.Release|Any CPU.ActiveCfg = Release|Any CPU
17+
{C9311E11-9C36-47CF-9E1D-E6048C1ABC3E}.Release|Any CPU.Build.0 = Release|Any CPU
18+
EndGlobalSection
19+
GlobalSection(SolutionProperties) = preSolution
20+
HideSolutionNode = FALSE
21+
EndGlobalSection
22+
GlobalSection(ExtensibilityGlobals) = postSolution
23+
SolutionGuid = {5113682A-4E45-4E0A-ABBE-E895565C278A}
24+
EndGlobalSection
25+
EndGlobal

Pages/Counter.razor

Lines changed: 0 additions & 16 deletions
This file was deleted.

Pages/Error.cshtml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
@page
2+
@model EditFormValidation.Pages.ErrorModel
3+
4+
<!DOCTYPE html>
5+
<html lang="en">
6+
7+
<head>
8+
<meta charset="utf-8" />
9+
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
10+
<title>Error</title>
11+
<link href="~/css/bootstrap/bootstrap.min.css" rel="stylesheet" />
12+
<link href="~/css/site.css" rel="stylesheet" asp-append-version="true" />
13+
</head>
14+
15+
<body>
16+
<div class="main">
17+
<div class="content px-4">
18+
<h1 class="text-danger">Error.</h1>
19+
<h2 class="text-danger">An error occurred while processing your request.</h2>
20+
21+
@if (Model.ShowRequestId)
22+
{
23+
<p>
24+
<strong>Request ID:</strong> <code>@Model.RequestId</code>
25+
</p>
26+
}
27+
28+
<h3>Development Mode</h3>
29+
<p>
30+
Swapping to the <strong>Development</strong> environment displays detailed information about the error that occurred.
31+
</p>
32+
<p>
33+
<strong>The Development environment shouldn't be enabled for deployed applications.</strong>
34+
It can result in displaying sensitive information from exceptions to end users.
35+
For local debugging, enable the <strong>Development</strong> environment by setting the <strong>ASPNETCORE_ENVIRONMENT</strong> environment variable to <strong>Development</strong>
36+
and restarting the app.
37+
</p>
38+
</div>
39+
</div>
40+
</body>
41+
42+
</html>

0 commit comments

Comments
 (0)