本文介绍了如何从gridview获得价值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

 InteractionName药物名称药物类型制造商名称药物描述
fff hhh Teblet cadila mmm
fff lll Teblet cadila mmm
fff hhh注射剂cadila ppp



-------------------------------------- --------------------------

以上是我的网格,我想传递交互名称,DrugId,和DrugName列,当我使用查询字符串点击交互名称..



-------------------- ---------

  protected   void  gvDrug_RowCommand( object  sender,GridViewCommandEventArgs e)
{
if (e.CommandName == cmdVi​​ew
{
R esponse.Redirect( AddNewDrug.aspx?DrugId = + e.CommandArgument.ToString());
}
if (e.CommandName == cmdInteractionName
{

Response.Redirect( DrugInteraction.aspx?InteractionId = + e.CommandArgument.ToString()+ DrugId =);

}
}
解决方案



InteractionName	Drug Name	Drug Type	Menufacturer Name	Drug Description
fff	        hhh	        Teblet	        cadila	                mmm
fff	        lll	        Teblet	        cadila	                mmm
fff	        hhh	        Injection	cadila	                ppp


----------------------------------------------------------------
above is my grid and i want to pass value of interaction name,DrugId,and DrugName column when i click on interaction name using query string..

-----------------------------

 protected void gvDrug_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            if (e.CommandName == "cmdView")
            {
                Response.Redirect("AddNewDrug.aspx?DrugId=" + e.CommandArgument.ToString());
            }
            if (e.CommandName == "cmdInteractionName")
            {

                Response.Redirect("DrugInteraction.aspx?InteractionId="+e.CommandArgument.ToString()+"DrugId=");

            }
}
解决方案



这篇关于如何从gridview获得价值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-03 19:53