CommandArgument 传递多个参数(以2个为例)

 
       
           
               
                   
               

               
                   
               

           

           
           
            
           
           
               
                   
               

               
                  

修改

               
           
           
               
                   
               

               
                   
CommandArgument='<%# Eval("Parent_Id")+","+Eval("Id")  %>'  runat="server">删除

               

           

          
       
       
       
       
       
       
   

 

protected void GVSecondType_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        string cmdName = e.CommandName;
        if (cmdName == "del")
        {
            string[] estr = e.CommandArgument.ToString().Split(',');

            int Parent_Id = Convert.ToInt32(estr[0]);
            int TypeId = Convert.ToInt32(estr[1]);
            bool flag = YHTBLL.Second_TypeManage.DelTypeById(Parent_Id, TypeId);
            if (flag)
            {
                this.Literal1.Text = "删 除 成 功";
                bind();
            }

            else
            {
                this.Literal1.Text = "删 除失 败";
                bind();
            }

        }
    
    }

 

你可能感兴趣的:(asp.net)