下拉列表不显示记录 [英] dropdownlist not showing records

查看:94
本文介绍了下拉列表不显示记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我的代码,我将数据绑定到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.


这篇关于下拉列表不显示记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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