ASP.NET - Adding an UpdatePanel trigger to a LinkButton inside a gridview

后端 未结 4 905
长发绾君心
长发绾君心 2020-12-06 03:29

I was trying to update the content of a modal dialog, and this code works for me:



        
4条回答
  •  无人及你
    2020-12-06 04:17

    Try and add the asp:AsyncPostBackTrigger to the asp:GridView's OnRowCommand event and handle the link button click in that event

    
         
               
         
    
    

    and in the cs create the event like this

    protected void grdListUsers_RowCommand(object sender, GridViewCommandEventArgs e)
    {
       if (e.CommandName == "update-something")
       {
          grdListUsers.SelectedIndex = Convert.ToInt32(e.CommandArgument);
       }
    }
    

提交回复
热议问题