很久没有写ASP.NET了,今天有看到论坛上一个问题:
"两个dropDownList和一个GridView,已经进行了数据绑定,现在想让第一个下拉菜单的数据改变时,第二个下拉菜单自动变到相应的数据,同时选中gridview中相对应的行,不知道如何实现,很急,求大神相助"
两个dropDownList和一个GridView的选择与显示


其实,实现起来算得上简单,下面先从准备数据开始,创建一个对象Customer:
两个dropDownList和一个GridView的选择与显示


source code:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

/// <summary>
/// Summary description for Customer
/// </summary>
namespace Insus.NET
{
    public class Customer
    {
        private int _CustomerID;
        private string _CustomerName;
        private string _PID;
        private bool _IsActived;

        public int CustomerID
        {
            get { return _CustomerID; }
            set { _CustomerID = value; }
        }
        public string CustomerName
        {
            get { return _CustomerName; }
            set { _CustomerName = value; }
        }
        public string PID
        {
            get { return _PID; }
            set { _PID = value; }
        }
        public bool IsActived
        {
            get { return _IsActived; }
            set { _IsActived = value; }
        }
    }
}
View Code

相关文章:

  • 2021-10-23
  • 2022-02-09
  • 2021-10-11
  • 2021-05-25
  • 2022-12-23
猜你喜欢
  • 2021-12-11
  • 2021-10-02
  • 2021-06-13
  • 2021-05-18
  • 2021-12-27
  • 2022-12-23
相关资源
相似解决方案