diff --git a/Practice/ValidWeb/Forma1.aspx b/Practice/ValidWeb/Forma1.aspx index 1d056f8..1d6462e 100644 --- a/Practice/ValidWeb/Forma1.aspx +++ b/Practice/ValidWeb/Forma1.aspx @@ -14,12 +14,12 @@
- +

- +

@@ -42,7 +42,7 @@

- +

diff --git a/Practice/ValidWeb/Forma1.aspx.cs b/Practice/ValidWeb/Forma1.aspx.cs index 2752290..215708f 100644 --- a/Practice/ValidWeb/Forma1.aspx.cs +++ b/Practice/ValidWeb/Forma1.aspx.cs @@ -47,15 +47,22 @@ namespace ValidWeb protected void Button1_Click(object sender, EventArgs e) { string name = TextBox1.Text; - if (Regex.IsMatch(name, @"[^a-zA-ZąčęėįšųūžĄČĘĖĮŠŲŪŽ]")) { return; } string surname = TextBox2.Text; - if (Regex.IsMatch(surname, @"[^a-zA-ZąčęėįšųūžĄČĘĖĮŠŲŪŽ]")) { return; } string school = TextBox3.Text; string age = DropDownList1.Text; - string language = CheckBoxList1.SelectedValue; + string language = ""; + foreach (ListItem item in CheckBoxList1.Items) + { + if (item.Selected) + { + language += item.Text + " "; + } + } + language = language.TrimEnd(); + string user = String.Join("|", name, surname, school, age, language); if (Session["users"] == null) { Session["users"] = user; diff --git a/Practice/ValidWeb/Forma1.aspx.designer.cs b/Practice/ValidWeb/Forma1.aspx.designer.cs index 65e31f5..e178ea1 100644 --- a/Practice/ValidWeb/Forma1.aspx.designer.cs +++ b/Practice/ValidWeb/Forma1.aspx.designer.cs @@ -7,13 +7,11 @@ // //------------------------------------------------------------------------------ -namespace ValidWeb -{ - - - public partial class Forma1 - { - +namespace ValidWeb { + + + public partial class Forma1 { + /// /// form1 control. /// @@ -22,7 +20,7 @@ namespace ValidWeb /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.HtmlControls.HtmlForm form1; - + /// /// Label5 control. /// @@ -31,7 +29,7 @@ namespace ValidWeb /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.Label Label5; - + /// /// ValidationSummary1 control. /// @@ -40,7 +38,7 @@ namespace ValidWeb /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.ValidationSummary ValidationSummary1; - + /// /// Label1 control. /// @@ -49,7 +47,7 @@ namespace ValidWeb /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.Label Label1; - + /// /// TextBox1 control. /// @@ -58,16 +56,16 @@ namespace ValidWeb /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.TextBox TextBox1; - + /// - /// RequiredFieldValidator1 control. + /// RegularExpressionValidator1 control. /// /// /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// - protected global::System.Web.UI.WebControls.RequiredFieldValidator RequiredFieldValidator1; - + protected global::System.Web.UI.WebControls.RegularExpressionValidator RegularExpressionValidator1; + /// /// Label6 control. /// @@ -76,7 +74,7 @@ namespace ValidWeb /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.Label Label6; - + /// /// TextBox2 control. /// @@ -85,16 +83,16 @@ namespace ValidWeb /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.TextBox TextBox2; - + /// - /// RequiredFieldValidator2 control. + /// RegularExpressionValidator2 control. /// /// /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// - protected global::System.Web.UI.WebControls.RequiredFieldValidator RequiredFieldValidator2; - + protected global::System.Web.UI.WebControls.RegularExpressionValidator RegularExpressionValidator2; + /// /// Label7 control. /// @@ -103,7 +101,7 @@ namespace ValidWeb /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.Label Label7; - + /// /// TextBox3 control. /// @@ -112,7 +110,7 @@ namespace ValidWeb /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.TextBox TextBox3; - + /// /// RequiredFieldValidator3 control. /// @@ -121,7 +119,7 @@ namespace ValidWeb /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.RequiredFieldValidator RequiredFieldValidator3; - + /// /// Label2 control. /// @@ -130,7 +128,7 @@ namespace ValidWeb /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.Label Label2; - + /// /// DropDownList1 control. /// @@ -139,7 +137,7 @@ namespace ValidWeb /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.DropDownList DropDownList1; - + /// /// RangeValidator1 control. /// @@ -148,7 +146,7 @@ namespace ValidWeb /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.RangeValidator RangeValidator1; - + /// /// Label3 control. /// @@ -157,7 +155,7 @@ namespace ValidWeb /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.Label Label3; - + /// /// CheckBoxList1 control. /// @@ -166,7 +164,7 @@ namespace ValidWeb /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.CheckBoxList CheckBoxList1; - + /// /// Kalbos control. /// @@ -175,7 +173,7 @@ namespace ValidWeb /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.XmlDataSource Kalbos; - + /// /// Button1 control. /// @@ -184,7 +182,7 @@ namespace ValidWeb /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.Button Button1; - + /// /// Button2 control. /// @@ -193,7 +191,7 @@ namespace ValidWeb /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.Button Button2; - + /// /// Label8 control. /// @@ -202,7 +200,7 @@ namespace ValidWeb /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.Label Label8; - + /// /// Table1 control. ///