Hi, I have to show customise popup message on the successful insertion of record.So why I have used ajax ModalPopup extender control and have called this from aspx codebehind. It works conditionally good. But as I press F5 then it reloads again. Though this time I have not inserted any record so that it can call show() method of ModalPopup. Kindly help me how to prevent reloading this popup itself.
<asp:Label ID="lblModalAlert" runat="server" style="display:none"></asp:Label>
<asp:ModalPopupExtender ID="modalpopupalert" runat="server" PopupControlID="Panel_alert" BehaviorID="mpe" TargetControlID="lblModalAlert" BackgroundCssClass="modalBackgroundalert"></asp:ModalPopupExtender>
<asp:Panel ID="Panel_alert" runat="server" style="display:none" >
<asp:UpdatePanel ID="updatePanel_Alert" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div>
<p id="alertParaID" style="text-decoration-color:red;">
Thank you for your interest in our company. Our executive will contact you shortly.
</p>
<%-- <button id="btnalertPop" type="submit" onclick="javascript:hideModalPop();">OK</button>--%>
<asp:Button ID="btnOKalert" runat="server" Text="OK" OnClick="btnOKalert_Click" />
</div>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Panel>
code behind
protected void btn_VSubmit_Click(object sender, EventArgs e)
{
// modalpopupalert.Hide();
InsertVendorEnquiryRecord();
modalpopupalert.Show();
}
protected void btnOKalert_Click(object sender, EventArgs e)
{
modalpopupalert.Hide();
}