Member
492 Points
200 Posts
Oct 04, 2013 12:04 AM|mdsajidfaizan|LINK
<form id="form1" runat="server"> <asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager> <asp:Button ID="btnShow" runat="server" Text="Show Modal Popup" /> <!-- ModalPopupExtender --> <cc1:ModalPopupExtender ID="mp1" runat="server" PopupControlID="Panel1" TargetControlID="btnShow" CancelControlID="btnClose" BackgroundCssClass="modalBackground"> </cc1:ModalPopupExtender> <asp:Panel ID="Panel1" runat="server" CssClass="modalPopup" align="center" style = "display:none"> This is an ASP.Net AJAX ModalPopupExtender Example<br /> <asp:Button ID="btnClose" runat="server" Text="Close" /> </asp:Panel> <!-- ModalPopupExtender --> </form>
in code behind: write:
if(textbox1.text!="YourCondition") { mp1.Show(); } else { Response.Redirect("Form2.aspx"); }
Member
492 Points
200 Posts
Re: ModalPopupExtender to act more like alert()?
Oct 04, 2013 12:04 AM|mdsajidfaizan|LINK
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:Button ID="btnShow" runat="server" Text="Show Modal Popup" />
<!-- ModalPopupExtender -->
<cc1:ModalPopupExtender ID="mp1" runat="server" PopupControlID="Panel1" TargetControlID="btnShow"
CancelControlID="btnClose" BackgroundCssClass="modalBackground">
</cc1:ModalPopupExtender>
<asp:Panel ID="Panel1" runat="server" CssClass="modalPopup" align="center" style = "display:none">
This is an ASP.Net AJAX ModalPopupExtender Example<br />
<asp:Button ID="btnClose" runat="server" Text="Close" />
</asp:Panel>
<!-- ModalPopupExtender -->
</form>
in code behind:
write:
if(textbox1.text!="YourCondition")
{
mp1.Show();
}
else
{
Response.Redirect("Form2.aspx");
}