Add TestWebApp
This commit is contained in:
13
.idea/.idea.VAR.WebFormsCore/.idea/.gitignore
generated
vendored
Normal file
13
.idea/.idea.VAR.WebFormsCore/.idea/.gitignore
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
# Default ignored files
|
||||||
|
/shelf/
|
||||||
|
/workspace.xml
|
||||||
|
# Rider ignored files
|
||||||
|
/modules.xml
|
||||||
|
/contentModel.xml
|
||||||
|
/.idea.VAR.WebFormsCore.iml
|
||||||
|
/projectSettingsUpdater.xml
|
||||||
|
# Editor-based HTTP Client requests
|
||||||
|
/httpRequests/
|
||||||
|
# Datasource local storage ignored files
|
||||||
|
/dataSources/
|
||||||
|
/dataSources.local.xml
|
||||||
4
.idea/.idea.VAR.WebFormsCore/.idea/encodings.xml
generated
Normal file
4
.idea/.idea.VAR.WebFormsCore/.idea/encodings.xml
generated
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="Encoding" addBOMForNewFiles="with BOM under Windows, with no BOM otherwise" />
|
||||||
|
</project>
|
||||||
8
.idea/.idea.VAR.WebFormsCore/.idea/indexLayout.xml
generated
Normal file
8
.idea/.idea.VAR.WebFormsCore/.idea/indexLayout.xml
generated
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="UserContentModel">
|
||||||
|
<attachedFolders />
|
||||||
|
<explicitIncludes />
|
||||||
|
<explicitExcludes />
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
6
.idea/.idea.VAR.WebFormsCore/.idea/vcs.xml
generated
Normal file
6
.idea/.idea.VAR.WebFormsCore/.idea/vcs.xml
generated
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="VcsDirectoryMappings">
|
||||||
|
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
45
VAR.WebFormsCore.TestWebApp/FrmDefault.cs
Normal file
45
VAR.WebFormsCore.TestWebApp/FrmDefault.cs
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
using System;
|
||||||
|
using VAR.WebFormsCore.Code;
|
||||||
|
using VAR.WebFormsCore.Controls;
|
||||||
|
using VAR.WebFormsCore.Pages;
|
||||||
|
|
||||||
|
namespace VAR.WebFormsCore.TestWebApp;
|
||||||
|
|
||||||
|
public class FrmDefault: PageCommon
|
||||||
|
{
|
||||||
|
private CTextBox _txtText = new CTextBox { ID = "txtText", CssClassExtra = "width150px", AllowEmpty = false };
|
||||||
|
private Button _btnTest = new Button { ID = "btnTest", };
|
||||||
|
private Label _lblMessage = new Label { ID = "lblMessage", };
|
||||||
|
|
||||||
|
public FrmDefault()
|
||||||
|
{
|
||||||
|
MustBeAuthenticated = false;
|
||||||
|
Init += FrmLogin_Init;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void FrmLogin_Init(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
InitializeControls();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void InitializeControls()
|
||||||
|
{
|
||||||
|
Title = MultiLang.GetLiteral("Default");
|
||||||
|
var lblTitle = new Label { Text = Title, Tag = "h2" };
|
||||||
|
Controls.Add(lblTitle);
|
||||||
|
|
||||||
|
Controls.Add(FormUtils.CreateField(MultiLang.GetLiteral("Text"), _txtText));
|
||||||
|
_txtText.PlaceHolder = MultiLang.GetLiteral("Text");
|
||||||
|
|
||||||
|
Controls.Add(FormUtils.CreateField(string.Empty, _btnTest));
|
||||||
|
_btnTest.Text = MultiLang.GetLiteral("Test");
|
||||||
|
_btnTest.Click += BtnTest_Click;
|
||||||
|
|
||||||
|
Controls.Add(FormUtils.CreateField(string.Empty, _lblMessage));
|
||||||
|
}
|
||||||
|
|
||||||
|
private void BtnTest_Click(object? sender, EventArgs e)
|
||||||
|
{
|
||||||
|
_lblMessage.Text = $"Hello World: {_txtText.Text}";
|
||||||
|
}
|
||||||
|
}
|
||||||
20
VAR.WebFormsCore.TestWebApp/Program.cs
Normal file
20
VAR.WebFormsCore.TestWebApp/Program.cs
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
using Microsoft.AspNetCore.Hosting;
|
||||||
|
using Microsoft.Extensions.Hosting;
|
||||||
|
|
||||||
|
namespace VAR.WebFormsCore.TestWebApp
|
||||||
|
{
|
||||||
|
public class Program
|
||||||
|
{
|
||||||
|
public static void Main(string[] args)
|
||||||
|
{
|
||||||
|
CreateHostBuilder(args).Build().Run();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static IHostBuilder CreateHostBuilder(string[] args) =>
|
||||||
|
Host.CreateDefaultBuilder(args)
|
||||||
|
.ConfigureWebHostDefaults(webBuilder =>
|
||||||
|
{
|
||||||
|
webBuilder.UseStartup<Startup>();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
28
VAR.WebFormsCore.TestWebApp/Properties/launchSettings.json
Normal file
28
VAR.WebFormsCore.TestWebApp/Properties/launchSettings.json
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
{
|
||||||
|
"iisSettings": {
|
||||||
|
"windowsAuthentication": false,
|
||||||
|
"anonymousAuthentication": true,
|
||||||
|
"iisExpress": {
|
||||||
|
"applicationUrl": "http://localhost:14577",
|
||||||
|
"sslPort": 44334
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"profiles": {
|
||||||
|
"VAR.WebFormsCore.TestWebApp": {
|
||||||
|
"commandName": "Project",
|
||||||
|
"dotnetRunMessages": true,
|
||||||
|
"launchBrowser": true,
|
||||||
|
"applicationUrl": "https://localhost:7260;http://localhost:5128",
|
||||||
|
"environmentVariables": {
|
||||||
|
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"IIS Express": {
|
||||||
|
"commandName": "IISExpress",
|
||||||
|
"launchBrowser": true,
|
||||||
|
"environmentVariables": {
|
||||||
|
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
0
VAR.WebFormsCore.TestWebApp/Scripts/keep.txt
Normal file
0
VAR.WebFormsCore.TestWebApp/Scripts/keep.txt
Normal file
25
VAR.WebFormsCore.TestWebApp/Startup.cs
Normal file
25
VAR.WebFormsCore.TestWebApp/Startup.cs
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
using Microsoft.AspNetCore.Builder;
|
||||||
|
using Microsoft.AspNetCore.Hosting;
|
||||||
|
using Microsoft.AspNetCore.Server.Kestrel.Core;
|
||||||
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
|
using VAR.WebFormsCore.Code;
|
||||||
|
|
||||||
|
namespace VAR.WebFormsCore.TestWebApp
|
||||||
|
{
|
||||||
|
public class Startup
|
||||||
|
{
|
||||||
|
public void ConfigureServices(IServiceCollection services)
|
||||||
|
{
|
||||||
|
// If using Kestrel:
|
||||||
|
services.Configure<KestrelServerOptions>(options =>
|
||||||
|
{
|
||||||
|
options.AddServerHeader = false;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
|
||||||
|
{
|
||||||
|
app.UseGlobalRouterMiddleware(env);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
0
VAR.WebFormsCore.TestWebApp/Styles/keep.txt
Normal file
0
VAR.WebFormsCore.TestWebApp/Styles/keep.txt
Normal file
24
VAR.WebFormsCore.TestWebApp/TestWebAppGlobalConfig.cs
Normal file
24
VAR.WebFormsCore.TestWebApp/TestWebAppGlobalConfig.cs
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
using System.Collections.Generic;
|
||||||
|
using Microsoft.AspNetCore.Http;
|
||||||
|
using VAR.WebFormsCore.Code;
|
||||||
|
|
||||||
|
namespace VAR.WebFormsCore.TestWebApp;
|
||||||
|
|
||||||
|
public class TestWebAppGlobalConfig: IGlobalConfig
|
||||||
|
{
|
||||||
|
public string Title { get; } = "TestWebApp";
|
||||||
|
public string TitleSeparator { get; } = " :: ";
|
||||||
|
public string Author { get; } = "XXX";
|
||||||
|
public string Copyright { get; } = "Copyright (c) 2022 by XXX, All Right Reserved";
|
||||||
|
public string DefaultHandler { get; } = nameof(FrmDefault);
|
||||||
|
public string LoginHandler { get; }
|
||||||
|
public List<string> AllowedExtensions { get; } = new List<string> { ".png", ".jpg", ".jpeg", ".gif", ".ico", ".wav", ".mp3", ".ogg", ".mp4", ".webm", ".webp", ".mkv", ".avi" };
|
||||||
|
public bool IsUserAuthenticated(HttpContext context)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void UserUnauthenticate(HttpContext context)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<TargetFramework>net6.0</TargetFramework>
|
||||||
|
<Nullable>enable</Nullable>
|
||||||
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\VAR.WebFormsCore\VAR.WebFormsCore.csproj" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
</Project>
|
||||||
8
VAR.WebFormsCore.TestWebApp/appsettings.Development.json
Normal file
8
VAR.WebFormsCore.TestWebApp/appsettings.Development.json
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"Logging": {
|
||||||
|
"LogLevel": {
|
||||||
|
"Default": "Information",
|
||||||
|
"Microsoft.AspNetCore": "Warning"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
9
VAR.WebFormsCore.TestWebApp/appsettings.json
Normal file
9
VAR.WebFormsCore.TestWebApp/appsettings.json
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"Logging": {
|
||||||
|
"LogLevel": {
|
||||||
|
"Default": "Information",
|
||||||
|
"Microsoft.AspNetCore": "Warning"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"AllowedHosts": "*"
|
||||||
|
}
|
||||||
22
VAR.WebFormsCore.sln
Normal file
22
VAR.WebFormsCore.sln
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
|
||||||
|
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VAR.WebFormsCore", "VAR.WebFormsCore\VAR.WebFormsCore.csproj", "{E0E00013-9FEF-4E28-A9FC-27A965737FBB}"
|
||||||
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VAR.WebFormsCore.TestWebApp", "VAR.WebFormsCore.TestWebApp\VAR.WebFormsCore.TestWebApp.csproj", "{0D81464B-802D-4ECA-92C8-427F481A4583}"
|
||||||
|
EndProject
|
||||||
|
Global
|
||||||
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
|
Debug|Any CPU = Debug|Any CPU
|
||||||
|
Release|Any CPU = Release|Any CPU
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
|
{E0E00013-9FEF-4E28-A9FC-27A965737FBB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{E0E00013-9FEF-4E28-A9FC-27A965737FBB}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{E0E00013-9FEF-4E28-A9FC-27A965737FBB}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{E0E00013-9FEF-4E28-A9FC-27A965737FBB}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{0D81464B-802D-4ECA-92C8-427F481A4583}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{0D81464B-802D-4ECA-92C8-427F481A4583}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{0D81464B-802D-4ECA-92C8-427F481A4583}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{0D81464B-802D-4ECA-92C8-427F481A4583}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
EndGlobalSection
|
||||||
|
EndGlobal
|
||||||
Reference in New Issue
Block a user