Skip to content

Commit 3f03f99

Browse files
Merge pull request SyncfusionExamples#6 from Backiaraj/UG
Prepared sample for ASP.NET Core Button control
2 parents 3e5fe78 + 5d73a02 commit 3f03f99

File tree

182 files changed

+149341
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

182 files changed

+149341
-0
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<Project Sdk="Microsoft.NET.Sdk.Web">
2+
3+
<PropertyGroup>
4+
<TargetFramework>net6.0</TargetFramework>
5+
<Nullable>enable</Nullable>
6+
<ImplicitUsings>enable</ImplicitUsings>
7+
</PropertyGroup>
8+
9+
<ItemGroup>
10+
<PackageReference Include="Syncfusion.EJ2.AspNet.Core" Version="20.2.0.40" />
11+
</ItemGroup>
12+
13+
</Project>
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.0.32112.339
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ButtonHowToSample", "ButtonHowToSample.csproj", "{B5BA6A12-99D7-409E-8408-FF010D21AECB}"
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+
{B5BA6A12-99D7-409E-8408-FF010D21AECB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{B5BA6A12-99D7-409E-8408-FF010D21AECB}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{B5BA6A12-99D7-409E-8408-FF010D21AECB}.Release|Any CPU.ActiveCfg = Release|Any CPU
17+
{B5BA6A12-99D7-409E-8408-FF010D21AECB}.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 = {704D3485-28C0-4537-A553-31807FA0B326}
24+
EndGlobalSection
25+
EndGlobal
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
@page
2+
@model ButtonHowToSample.Pages.BlockButtonModel
3+
@{
4+
}
5+
<ejs-button id="blockbtn" content="BLOCKBUTTON" cssClass="e-block"></ejs-button>
6+
<ejs-button id="primarybtn" content="BLOCKBUTTON" cssClass="e-block" isPrimary="true"></ejs-button>
7+
<ejs-button id="successbtn" content="BLOCKBUTTON" cssClass="e-block e-success"></ejs-button>
8+
9+
<style>
10+
11+
button {
12+
margin: 25px 0;
13+
}
14+
15+
</style>
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
using Microsoft.AspNetCore.Mvc;
2+
using Microsoft.AspNetCore.Mvc.RazorPages;
3+
4+
namespace ButtonHowToSample.Pages
5+
{
6+
public class BlockButtonModel : PageModel
7+
{
8+
public void OnGet()
9+
{
10+
}
11+
}
12+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
@page
2+
@model ButtonHowToSample.Pages.CustomButtonModel
3+
@{
4+
}
5+
<ejs-button id="custom" cssClass="e-custom" content="CUSTOM"></ejs-button>
6+
7+
<style>
8+
9+
.e-custom {
10+
border-radius: 0;
11+
height: 30px;
12+
width: 80px;
13+
}
14+
15+
.e-custom, .e-custom:hover, .e-custom:focus, .e-custom:active {
16+
background-color: #ff6e40;
17+
color: #fff;
18+
}
19+
20+
button {
21+
margin: 25px 5px 20px 20px;
22+
}
23+
24+
</style>
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
using Microsoft.AspNetCore.Mvc;
2+
using Microsoft.AspNetCore.Mvc.RazorPages;
3+
4+
namespace ButtonHowToSample.Pages
5+
{
6+
public class CustomButtonModel : PageModel
7+
{
8+
public void OnGet()
9+
{
10+
}
11+
}
12+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
@page
2+
@model ButtonHowToSample.Pages.DisableStateModel
3+
@{
4+
}
5+
<ejs-button id="disabled" disabled="true" content="Disabled"></ejs-button>
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
using Microsoft.AspNetCore.Mvc;
2+
using Microsoft.AspNetCore.Mvc.RazorPages;
3+
4+
namespace ButtonHowToSample.Pages
5+
{
6+
public class DisableStateModel : PageModel
7+
{
8+
public void OnGet()
9+
{
10+
}
11+
}
12+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
@page
2+
@model ErrorModel
3+
@{
4+
ViewData["Title"] = "Error";
5+
}
6+
7+
<h1 class="text-danger">Error.</h1>
8+
<h2 class="text-danger">An error occurred while processing your request.</h2>
9+
10+
@if (Model.ShowRequestId)
11+
{
12+
<p>
13+
<strong>Request ID:</strong> <code>@Model.RequestId</code>
14+
</p>
15+
}
16+
17+
<h3>Development Mode</h3>
18+
<p>
19+
Swapping to the <strong>Development</strong> environment displays detailed information about the error that occurred.
20+
</p>
21+
<p>
22+
<strong>The Development environment shouldn't be enabled for deployed applications.</strong>
23+
It can result in displaying sensitive information from exceptions to end users.
24+
For local debugging, enable the <strong>Development</strong> environment by setting the <strong>ASPNETCORE_ENVIRONMENT</strong> environment variable to <strong>Development</strong>
25+
and restarting the app.
26+
</p>
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
using Microsoft.AspNetCore.Mvc;
2+
using Microsoft.AspNetCore.Mvc.RazorPages;
3+
using System.Diagnostics;
4+
5+
namespace ButtonHowToSample.Pages
6+
{
7+
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
8+
[IgnoreAntiforgeryToken]
9+
public class ErrorModel : PageModel
10+
{
11+
public string? RequestId { get; set; }
12+
13+
public bool ShowRequestId => !string.IsNullOrEmpty(RequestId);
14+
15+
private readonly ILogger<ErrorModel> _logger;
16+
17+
public ErrorModel(ILogger<ErrorModel> logger)
18+
{
19+
_logger = logger;
20+
}
21+
22+
public void OnGet()
23+
{
24+
RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier;
25+
}
26+
}
27+
}

0 commit comments

Comments
 (0)