DropDownList填充其他DropDownLists [英] DropDownList to populate other DropDownLists

查看:76
本文介绍了DropDownList填充其他DropDownLists的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含11个DropDownLists的表单。主要下拉列表中包含学校名称。我希望能够从主要下拉列表中选择学校,其他10个下拉列表将填充该学校的年份。然后,当我选择任何年份并选择填充文本框时。是否有一个示例代码可以帮助我这个?



I have a form with 11 DropDownLists. The main dropdownlist has school names in it. I want to have it where I can select the school from the main dropdownlist and the other 10 dropdownlists will populate with the years from that school. Then when I select what ever year and have that selection to populate the textboxes. Is there a sample code that can help me on this?

using System;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Drawing;
using System.Text;
using System.Data;
using System.Collections.Generic;
using System.Linq;
using System.Data.SqlClient;
using System.Configuration;
using System.Drawing.Printing;
public partial class SchoolReports : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void DropDownListSchools_SelectedIndexChanged(object sender, EventArgs e)
    {
        SqlConnection con = new SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["PassConnectionString"].ConnectionString);
        con.Open(); 
    }
    protected void DropDownListCFY1_SelectedIndexChanged(object sender, EventArgs e)
    {

    }
    protected void DropDownListCFY2_SelectedIndexChanged(object sender, EventArgs e)
    {

    }
    protected void DropDownListCFY3_SelectedIndexChanged(object sender, EventArgs e)
    {

    }
    protected void DropDownListCFY4_SelectedIndexChanged(object sender, EventArgs e)
    {

    }
    protected void DropDownListCFY5_SelectedIndexChanged(object sender, EventArgs e)
    {

    }
    protected void DropDownListFY1_SelectedIndexChanged(object sender, EventArgs e)
    {

    }
    protected void DropDownListFY2_SelectedIndexChanged(object sender, EventArgs e)
    {

    }
    protected void DropDownListFY3_SelectedIndexChanged(object sender, EventArgs e)
    {

    }
    protected void DropDownListFY4_SelectedIndexChanged(object sender, EventArgs e)
    {

    }
    protected void DropDownListFY5_SelectedIndexChanged(object sender, EventArgs e)
    {

    }
}

推荐答案

不,没有这样的你想要的代码类型。因为你的问题领域与世界上任何其他项目完全不同(每个人都是如此)。并且在你雇用其中一个之前也没有人会尝试解决你的问题。

所以最好学习如何做这些事情并尝试自己。如果你遇到困难,那么与我们分享你的代码具体问题。

这些将帮助你做这些事情..

http://www.aspdotnet-suresh.com/2010/10/how-to-populate-dropdown-based-on-other.html [ ^ ]

http://forums.asp.net/t/ 1276841.aspx [ ^ ]

http://forums.asp.net/t/1431726.aspx [ ^ ]
No,there are not such type of code available of what you want.Because your problem domain is completely different from any other projects of the world(it is true for every person). And also no one will try to solve your problem until you hire one of them.
So it's better to learn how to do these things and try yourself.If you get stuck then share your code with us with specific problem.
These will help you to do that things..
http://www.aspdotnet-suresh.com/2010/10/how-to-populate-dropdown-based-on-other.html[^]
http://forums.asp.net/t/1276841.aspx[^]
http://forums.asp.net/t/1431726.aspx[^]


这篇关于DropDownList填充其他DropDownLists的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆