c# Repeater中CommandArgument传多个参数

<ItemTemplate>

    <div onmouseover="javascript:this.style.cursor='hand'" style="width:70px; line-height:20px;background-color:#CCCCCC;border:solid 1px #000000;"> <asp:LinkButton ID="LinkButton1" CommandName="del" CommandArgument='<%# eval_r("Parent_Id")+","+eval_r("Id")  %>'  runat="server">删除</asp:LinkButton></div>
</ItemTemplate>
后台的代码是:

 

protected void GVSecondType_RowCommand(object sender, GridViewCommandEventArgse)
    {
        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]);
         }
    
    }

 

 

 

posted @ 2011-12-02 10:10  Randolph Liu  阅读(2343)  评论(0编辑  收藏  举报