yueyue, I have fallen in love with you for

2011-02-09, 01:18:25 PM

DropDownList的神奇用法

Posted on 2011-08-31 15:19  张超的博客  阅读(169)  评论(0)    收藏  举报

for (int i = 0; i < dtB.Rows.Count; i++)
            {
                ListItem LI = new ListItem();
                LI.Text = dtB.Rows[i]["Property_Name"].ToString();
                LI.Value = dtB.Rows[i]["Property_Num"].ToString();
                drokzjb.Items.Add(LI);
            }

 

分析存入以上的值其中:text为显示在DropDownList中的值,value为   在dropdownlist的text取值的时候取出来的值。

string hy = "";
        hy = drohy.Text.Trim();
        //string zdlx = "";
        //zdlx = drolx.Text.Trim();
        string kzjb = "";
        kzjb = drokzjb.Text.Trim();
       
        Response.Write(kzjb);
        if (hy != ""||kzjb!="")
        {
            url = "<script language=javascript>";
            url += "parent.botFrame.location='leftbottom.aspx?hy=" + hy + "&kzjb="+kzjb+"'";
            url += "</script>";
            Response.Write(url);
        }

博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3