下拉列表不显示记录

编程入门 行业动态 更新时间:2024-10-26 12:30:25
本文介绍了下拉列表不显示记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

这是我的代码,我将数据绑定到ddl,当我调试代码时,它正确显示所有值,但是当我运行相同时,它既不显示任何值也不显示错误...

this is my code where i am binding data to ddl, when i debug the code, it shows all values correctly, but when i run the same, it neither shows any value nor gives Error...

protected void ddlGodownName_SelectedIndexChanged(object sender, EventArgs e) { if (ddlGodownName.Text!="") { objLocationMaster.IntMode = 9; objLocationMaster.GodawnName = ddlGodownName.Text.Trim(); DataTable dt = objBAL.getDistinctColumns(objLocationMaster); for (int i = 0; i < dt.Rows.Count; i++) { ddlrowno.Items.Add(dt.Rows[i]["RowNo"].ToString()); ddlcolno.Items.Add(dt.Rows[i]["columnno"].ToString()); ddllvlno.Items.Add(dt.Rows[i]["LevelNo"].ToString()); } ddlrowno.Items.Add("Hi"); // ddlrowno.DataTextField = "RowNo"; //ddlrowno.DataValueField = "RowNo"; //ddlrowno.DataBind(); //ddlcolno.DataSource = dt; //ddlcolno.DataTextField = "columnno"; //ddlcolno.DataValueField = "columnno"; //ddlcolno.DataBind(); //ddllvlno.DataSource = dt; //ddllvlno.DataTextField = "LevelNo"; //ddllvlno.DataValueField = "LevelNo"; //ddllvlno.DataBind(); } }

推荐答案

你有任何更新面板.................检查你的更新面板更新面板有时候这样做 do you have any update panels .................check your update panels update panels some time do like this

检查是否设置了AutoPostBack属性。如果它被设置,则它不会触发事件。 Check whether the AutoPostBack property is set on or not. If it is set off then it will not fire the event.

如果ddlGodownName的autopostback属性设置为true,你能否确认。 Can you confirm, if the autopostback property of ddlGodownName is set as true.

更多推荐

下拉列表不显示记录

本文发布于:2023-11-14 04:53:36,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1586275.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:列表

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!