Popup bootstrap model on GridView edit click using RowCommand event

前端 未结 2 1852
独厮守ぢ
独厮守ぢ 2020-12-16 18:22

I have a Bootstrap Model popup:







        
2条回答
  •  误落风尘
    2020-12-16 18:56

    Here can be a solution and follow bellow steps:

    • Add GridView also in another UpdatePanel.
    • Trigger GridView RowCommand event in first UpdatePanel upModel as like:

      
      
            
      
      
    • And finally run below StringBuilder code in RowCommand event:

      case "EditRow":
          lblID.Text = id;
          txtName.Text = name;
      
          System.Text.StringBuilder sb = new System.Text.StringBuilder();
          sb.Append(@"");
          ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "MyModal", 
          sb.ToString(), false);
      
          break;
      

    It will display popup on edit click as:

提交回复
热议问题