register.aspx.cs
(开头部分) 4KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Data;
using ClassLibrary2;
using System.Collections;
public partial class register : System.Web.UI.Page
{
string str = System.Configuration.ConfigurationManager.AppSettings["str_con"].ToString(); //连接数据库
SqlConnection conn = null;
SqlCommand cmd = null;
protected void Page_Load(object sender, EventArgs e)
{
DropDownList1.SelectedIndexChanged += DropDownList1_SelectedIndexChanged;
DropDownList2.SelectedIndexChanged += DropDownList2_SelectedIndexChanged;
if (IsPostBack == false)
{
List<Chinast> sheng = new ChinastData().selectAll("0001");
DropDownList1.DataSource = sheng;
DropDownList1.DataTextField = "Aname";
DropDownList1.DataValueField = "Acode";
DropDownList1.DataBind();
List<Chinast> shi = new ChinastData().selectAll(DropDownList1.SelectedItem.Value);
DropDownList2.DataSource = shi;
DropDownList2.DataTextField = "Aname";
DropDownList2.DataValueField = "Acode";
DropDownList2.DataBind();
List<Chinast> qu = new ChinastData().selectAll(DropDownList2.SelectedItem.Value);
DropDownList3.DataSource = qu;
DropDownList3.DataTextField = "Aname";
DropDownList3.DataValueField = "Acode";
DropDownList3.DataBind();
}
}
protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
{
List<Chinast> shi = new ChinastData().selectAll(DropDownList1.SelectedItem.Value);
DropDownList2.DataSource = shi;
DropDownList2.DataTextField = "Aname";
DropDownList2.DataValueField = "Acode";
DropDownList2.DataBind();
List<Chinast> qu = new ChinastData().selectAll(DropDownList2.SelectedItem.Value);
DropDownList3.DataSource = qu;
DropDownList3.DataTextField = "Aname";
DropDownList3.DataValueField = "Acode";
DropDownList3.DataBind();
}
protected void DropDownList2_SelectedIndexChanged(object sender, EventArgs e)
{
后面还有 69 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。