1
0

fix: add member counter to "Practice.ValidWeb"

This commit is contained in:
Rokas Puzonas 2022-02-20 22:05:43 +02:00
parent ee066855b6
commit 633c91bb72
9 changed files with 85 additions and 3 deletions

View File

@ -13,6 +13,7 @@ namespace ValidWeb
protected void Button2_Click(object sender, EventArgs e)
{
Session.Clear();
Label8.Text = "Dalyvių kiekis: 0";
for (int i = Table1.Rows.Count-1; i > 0; i--)
{
Table1.Rows.RemoveAt(i);

View File

@ -44,6 +44,8 @@
<br />
<asp:Button ID="Button2" runat="server" Text="Išvalyti" OnClick="Button2_Click" />
<br />
<br />
<asp:Label ID="Label8" runat="server" Text="Dalyvių kiekis: 0"></asp:Label>
<br />
<asp:Table ID="Table1" runat="server" BackColor="#FFFFCC" BorderColor="Black" BorderStyle="Solid" BorderWidth="1px" GridLines="Both">
</asp:Table>

View File

@ -24,6 +24,7 @@ namespace ValidWeb
TableRow header = new TableRow();
header.Cells.Add(new TableCell { Text = "<b>Nr</b>" });
header.Cells.Add(new TableCell { Text = "<b>Vardas</b>" });
header.Cells.Add(new TableCell { Text = "<b>Pavardė</b>" });
header.Cells.Add(new TableCell { Text = "<b>Mokykla</b>" });
@ -68,15 +69,15 @@ namespace ValidWeb
{
TableRow row = new TableRow();
row.Cells.Add(new TableCell { Text = Table1.Rows.Count.ToString() });
row.Cells.Add(new TableCell { Text = name });
row.Cells.Add(new TableCell { Text = surname });
row.Cells.Add(new TableCell { Text = school });
row.Cells.Add(new TableCell { Text = age });
row.Cells.Add(new TableCell { Text = language });
Label8.Text = String.Format("Dalyvių kiekis: {0}", Table1.Rows.Count);
Table1.Rows.Add(row);
}
}
}

View File

@ -194,6 +194,15 @@ namespace ValidWeb
/// </remarks>
protected global::System.Web.UI.WebControls.Button Button2;
/// <summary>
/// Label8 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Label Label8;
/// <summary>
/// Table1 control.
/// </summary>

View File

@ -1,4 +1,4 @@
using System.Reflection;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

View File

@ -72,8 +72,12 @@
<Content Include="Web.config">
<SubType>Designer</SubType>
</Content>
<Content Include="WebForm1.aspx" />
</ItemGroup>
<ItemGroup>
<Compile Include="Forma1-clear.aspx.cs">
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Forma1.aspx.cs">
<DependentUpon>Forma1.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
@ -82,6 +86,13 @@
<DependentUpon>Forma1.aspx</DependentUpon>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="WebForm1.aspx.cs">
<DependentUpon>WebForm1.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="WebForm1.aspx.designer.cs">
<DependentUpon>WebForm1.aspx</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />

View File

@ -0,0 +1,15 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="ValidWeb.WebForm1" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
</div>
</form>
</body>
</html>

View File

@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace ValidWeb
{
public partial class WebForm1 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
}
}

View File

@ -0,0 +1,26 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace ValidWeb
{
public partial class WebForm1
{
/// <summary>
/// form1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
}
}