大家帮忙看一下,我是在一个三级分类信息时这样的~我的结构如下:A
A1
A11
A22
A2
B
B1
B11
C这样的形式在大A下用一个DropDownList1 来控制表格
然后到行A1时,用DropDownList2来控制,并且中间用了一个〈Br>下面再用了DropDownList3来显示A11这样的
A1
A11
A22
A2
B
B1
B11
C这样的形式在大A下用一个DropDownList1 来控制表格
然后到行A1时,用DropDownList2来控制,并且中间用了一个〈Br>下面再用了DropDownList3来显示A11这样的
解决方案 »
- iReaper问题?
- 全屏网页怎么最小化
- __doPostBack()出现Object expected错误
- 大家帮我解释下段代码。。谢谢!!
- 高手救急:ASP.NET多系统(网站,论坛,其它业务系统)如何设计用户权限
- 像中华网(http://www.china.com/zh_cn/)页面中,“新闻”、“品味”、“健康”、“宽频”、“汽车”、“体育”、“English”这几个选项
- 高手请进!!vs2005 中 把存在数据源Sqldatasource1中的数据条数, 用数量表示 然后 用lable显示数量值!!
- 请问如何在控件子属性中实现UrlEditor编辑器
- vb.net+aspx 如何访问datagrid的模板列内的控件的属性
- 关于复合控件的问题
- Response.Redirect跳转
- 用asp.net(C#)+SQL数据库 会员的登录
Small_Id是DropDownList12
Small_Small_Id是DropDownList3在运行时,总是说
foreach(DataListItem dls in this.Small_Id.Items)这一行出错,请大家帮忙看一下~谢~
#region 显示大类信息
private void Big_type()
{
DataBaseOperation dbo=new DataBaseOperation(Application["ConnStr"].ToString());
string sqlText=String.Empty;
sqlText="select Big_Id,Big_Name from Big_type order by Big_Id ";
DataTable dtx=dbo.SqlDb.ExecuteRtnTable(sqlText);
this.Big_Id.DataSource=dtx;
this.Big_Id.DataBind();
BindSub(dbo);
dbo.Dispose();
}
#endregion
private void BindSub(DataBaseOperation dbo)
{
string sqlText="select x.Small_Id,x.Small_Name,y.Big_Id from Small_type x,Big_type y where x.Big_Id={0} and y.Big_Id=X.Big_Id order by x.Small_Id";
foreach(DataListItem dli in this.Big_Id.Items)
{
if(dli.ItemType!=ListItemType.Footer&&dli.ItemType!=ListItemType.Header)
{
DataList dl=(DataList)dli.FindControl("Small_Id");
if(dl!=null)
{
string sqlText1=String.Format(sqlText,this.Big_Id.DataKeys[dli.ItemIndex]);
dl.DataSource=dbo.SqlDb.ExecuteRtnTable(sqlText1);
dl.DataBind();
BindSub1(dbo);
}
}
}
} private void BindSub1(DataBaseOperation dbo)
{
string sqltxt=string.Empty;
sqltxt="select x.Small_Small_Id,x.Small_Small_Name,x.Small_Id,x.Big_Id,y.Small_Id from Small_Small_type x,Small_type y where x.Small_Id=1 and y.Small_Id=X.Small_Id order by x.Small_Small_Id ";
foreach(DataListItem dls in this.Small_Id.Items)
{
if(dls.ItemType!=ListItemType.Footer&&dls.ItemType!=ListItemType.Header)
{
DataList dl_s=(DataList)dls.FindControl("Small_Small_Id");
if(dl_s!=null)
{
string sqlText2=String.Format(sqltxt,this.Small_Id.DataKeys[dls.ItemIndex]);
dl_s.DataSource=dbo.SqlDb.ExecuteRtnTable(sqlText2);
dl_s.DataBind();
}
}
}
}