diff --git a/oop/first_webform/first_webform/first_webform.csproj b/oop/first_webform/first_webform/first_webform.csproj index 8966846..5398dc3 100644 --- a/oop/first_webform/first_webform/first_webform.csproj +++ b/oop/first_webform/first_webform/first_webform.csproj @@ -65,6 +65,7 @@ + @@ -82,6 +83,13 @@ + + multiplication_table.aspx + ASPXCodeBehind + + + multiplication_table.aspx + random_numbers.aspx ASPXCodeBehind diff --git a/oop/first_webform/first_webform/multiplication_table.aspx b/oop/first_webform/first_webform/multiplication_table.aspx new file mode 100644 index 0000000..d2ec7fd --- /dev/null +++ b/oop/first_webform/first_webform/multiplication_table.aspx @@ -0,0 +1,27 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="multiplication_table.aspx.cs" Inherits="first_webform.multiplication_table" %> + + + + + + + + + +
+
+
+ + +
+ + diff --git a/oop/first_webform/first_webform/multiplication_table.aspx.cs b/oop/first_webform/first_webform/multiplication_table.aspx.cs new file mode 100644 index 0000000..c5cbf7f --- /dev/null +++ b/oop/first_webform/first_webform/multiplication_table.aspx.cs @@ -0,0 +1,45 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +namespace first_webform +{ + public partial class multiplication_table : System.Web.UI.Page + { + protected void Page_Load(object sender, EventArgs e) + { + if (!Page.IsPostBack) + { + // Total number of rows. + int rowCnt; + // Current row count. + int rowCtr; + // Total number of cells per row (columns). + int cellCtr; + // Current cell counter + int cellCnt; + + rowCnt = 10; + cellCnt = 10; + + for (rowCtr = 1; rowCtr <= rowCnt; rowCtr++) + { + // Create new row and add it to the table. + TableRow tRow = new TableRow(); + Table1.Rows.Add(tRow); + for (cellCtr = 1; cellCtr <= cellCnt; cellCtr++) + { + // Create a new cell and add it to the row. + TableCell tCell = new TableCell(); + tCell.Text = Convert.ToString(rowCtr * cellCtr); + tRow.Cells.Add(tCell); + } + } + + } + } + } +} \ No newline at end of file diff --git a/oop/first_webform/first_webform/multiplication_table.aspx.designer.cs b/oop/first_webform/first_webform/multiplication_table.aspx.designer.cs new file mode 100644 index 0000000..cb74c5a --- /dev/null +++ b/oop/first_webform/first_webform/multiplication_table.aspx.designer.cs @@ -0,0 +1,33 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace first_webform { + + + public partial class multiplication_table { + + /// + /// form1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// Table1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Table Table1; + } +}