Hello Sir,
Im trying to edit the gridview row in modal popup, here when i
click on edit button a modal popup is displayed where the data is fetched based on gridview Id, without performing edit operation if i close the modal popup and performs the search function then again the modal popup is displayed.
Please help me in how to avoid displaying of modal popup even after closing it
protected void Page_Load(object sender, EventArgs e)
{
if (IsPostBack)
{
if (Request.Form[hidUpdate.UniqueID].ToString() == "GetData")
{
btn_complain_update.Visible = true;
GetData();
}
if (Request.Form[hidUpdate.UniqueID].ToString() == "Update")
{
UpdateData();
hidUpdate.Value = "";
BindGrid();
}
if (Request.Form[hidDelete.UniqueID].ToString() == "Delete")
{
DeleteData();
hidUpdate.Value = "";
BindGrid();
}
}
BindGrid();
}
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="false" AllowPaging="true"
OnPageIndexChanging="OnPageIndexChanging" PageSize="10">
<Columns>
<asp:BoundField ItemStyle-Width="150px" DataField="CustomerID" HeaderText="Customer ID" />
<asp:BoundField ItemStyle-Width="150px" DataField="ContactName" HeaderText="Contact Name" />
<asp:BoundField ItemStyle-Width="150px" DataField="City" HeaderText="City" />
<asp:BoundField ItemStyle-Width="150px" DataField="Country" HeaderText="Country" />
<asp:TemplateField HeaderText="Actions">
</asp:TemplateField>
</Columns>
</asp:GridView>
<input id="hidUpdate" runat="server" type="hidden" />
<input type="hidden" id="UpdateId" runat="server" />
<input id="hidDelete" runat="server" type="hidden" />
<input type="hidden" id="DeleteId" runat="server" />