From 5761a863346838d7c6bcb62cb24bcf58b51dcbff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?33=E7=89=9B=E6=96=87=E8=BD=A9?= <3336438209@qq.com> Date: Tue, 24 May 2022 23:48:02 +0800 Subject: [PATCH] . --- .../WebForm1.aspx.cs" | 58 +++++++++++++++++++ .../WebForm1.aspx.cs" | 39 +++++++++++++ 2 files changed, 97 insertions(+) create mode 100644 "33\347\211\233\346\226\207\350\275\251/ASP.NET\344\275\234\344\270\232/WebForm1.aspx.cs" create mode 100644 "33\347\211\233\346\226\207\350\275\251/\344\275\234\344\270\232/WebForm1.aspx.cs" diff --git "a/33\347\211\233\346\226\207\350\275\251/ASP.NET\344\275\234\344\270\232/WebForm1.aspx.cs" "b/33\347\211\233\346\226\207\350\275\251/ASP.NET\344\275\234\344\270\232/WebForm1.aspx.cs" new file mode 100644 index 0000000..1ef81dc --- /dev/null +++ "b/33\347\211\233\346\226\207\350\275\251/ASP.NET\344\275\234\344\270\232/WebForm1.aspx.cs" @@ -0,0 +1,58 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +namespace WebApplication1 +{ + public partial class WebForm1 : System.Web.UI.Page + { + protected void Page_Load(object sender, EventArgs e) + { + + } + + protected void Button1_Click(object sender, EventArgs e) + { + double a = double.Parse(TextBox1.Text); + double b = double.Parse(TextBox2.Text); + double aa = a + b; + Label1.Text = aa.ToString(); + } + + protected void Button2_Click(object sender, EventArgs e) + { + double a = double.Parse(TextBox1.Text); + double b = double.Parse(TextBox2.Text); + double aa = a - b; + Label1.Text = aa.ToString(); + } + + protected void Button3_Click(object sender, EventArgs e) + { + double a = double.Parse(TextBox1.Text); + double b = double.Parse(TextBox2.Text); + double aa = a * b; + Label1.Text = aa.ToString(); + } + + protected void Button4_Click(object sender, EventArgs e) + { + double a = double.Parse(TextBox1.Text); + double b = double.Parse(TextBox2.Text); + double aa = 0; + if (b == 0) + { + Label1.Text = "除数不能为0"; + return; + } + else { + + aa = a / b; + } + Label1.Text = aa.ToString(); + } + } +} \ No newline at end of file diff --git "a/33\347\211\233\346\226\207\350\275\251/\344\275\234\344\270\232/WebForm1.aspx.cs" "b/33\347\211\233\346\226\207\350\275\251/\344\275\234\344\270\232/WebForm1.aspx.cs" new file mode 100644 index 0000000..33e36a8 --- /dev/null +++ "b/33\347\211\233\346\226\207\350\275\251/\344\275\234\344\270\232/WebForm1.aspx.cs" @@ -0,0 +1,39 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +namespace WebApplication1 +{ + public partial class WebForm1 : System.Web.UI.Page + { + protected void Page_Load(object sender, EventArgs e) + { + if (!Page.IsPostBack) { + SqlDataSource1.SelectCommand = "select * from city where type=1 "; + + SqlDataSource2.SelectCommand = "select * from city where type=2 and pid=2"; + SqlDataSource3.SelectCommand = "select * from city where type=3 and pid in (select id from city where type = 2 and pid = 2)"; + } + + } + + protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e) + { + SqlDataSource2.SelectCommand = "select * from city where type=2 and pid=" + DropDownList1.SelectedValue; + SqlDataSource3.SelectCommand = "select * from city where type=3 and pid in (select id from city where type = 2 and pid = " + DropDownList1.SelectedValue+")"; + } + + protected void DropDownList2_SelectedIndexChanged(object sender, EventArgs e) + { + SqlDataSource3.SelectCommand = "select * from city where type=3 and pid =" + DropDownList2.SelectedValue; + } + + protected void DropDownList3_SelectedIndexChanged(object sender, EventArgs e) + { + + } + } +} \ No newline at end of file -- Gitee