Add TestWebApp
This commit is contained in:
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}";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user