Hi there,
Place your boostrap popup structure (or just your txtCategoryName control) inside an updatepanel with UpdateMode set to Conditional. Either set a trigger for the appropriate gridview event (GVCategoryDetails_RowCommand) or update it from code behind:
YourUpdatePanel.Update();
That should do it.
2019/02/12: Update.
Given your comment "When I use modal inside update panel I can't access txtCategoryName from Code behind", I can only assume you are interacting with your model purely from client-side js.
Please, take a look at this example (bootstrap 4.1.1):
<asp:UpdatePanel ID="UpdPnlModalTest" runat="server" ChildrenAsTriggers="false" UpdateMode="Conditional">
<Triggers> <asp:AsyncPostBackTrigger ControlID="btnTest" EventName="Click" /> </Triggers>
<ContentTemplate>
<div class="modal fade" id="modal_Test" role="dialog" tabindex="-1">
<div class="modal-dialog modal-dialog-centered">
<div class=" modal-content">
<div class="modal-header">
<h2 class="modal-title col-10">Modal Test</h2>
<button type="button" class="close" data-dismiss="modal">×</button>
</div>
<div class="modal-body">
<asp:Label ID="lbTestData" runat="server"></asp:Label>
</div>
<div class="modal-footer"></div>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
I make this modal visible from code behind:
... void btnTest_Click(object sender, EventArgs e)
{
lbTestData.Text = "Some string value for testing purposes!";
ScriptManager.RegisterStartupScript(objPage, objType, "ShowIt",
"$(document).ready(function() { $('#modal_Test').modal('show'); });", true);
}
Give it a test run.
Good luck!
PD. You are implementing a ScriptManager in your MasterPage, right?
<asp:ScriptManager ID="AjaxMngr" runat="server" EnablePartialRendering="true"> </asp:ScriptManager>