问题描述:在一个DataList中,有一个模板列是DropDownList,有一个模板列是LinkButton

  当我选择了DropDownList,在点LinkButton时,要把DropDownList选中的值传过去

但是传不过去。。。。

解决办法:

protected void gv_List_RowDataBound(object sender, GridViewRowEventArgs e)
{
          
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
             
               //传一个控件的值(在RowDataBound事件中)
                if (hlk_Flag.Text == JTSCM.Enum.ReceiveItemBatchEnum.Y.ToString())
                {
                    string openDialogJs = "openDialog('ReceiveBthManager.aspx?                         selectWareHouse='+document.getElementById(\"{1}\").options                         [document.getElementById(\"{1}\").selectedIndex].value+ '&RECEIVEID=                                       {0}','btn_ShowInit');return false;";
                    hlk_Flag.OnClientClick = string.Format(openDialogJs, receiveID, ddl_whid.ClientID);
                    hlk_Flag.Enabled = true;                   
                }
            }
}

相关文章:

  • 2021-10-16
  • 2021-06-03
  • 2022-12-23
  • 2022-12-23
  • 2021-12-05
  • 2021-12-18
猜你喜欢
  • 2022-01-29
  • 2021-10-16
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-20
相关资源
相似解决方案