Hide ModalPopup Using Javascript


When I first started using Asp.Net Ajax toolkit, I found there is a very fundamental requirement from lot of developers where we want to have some kinds of control on the client side without triggering the service side event. here I have JavaScript using which we can hide/show modelpopup. It is also using at runtime. for more tips visit http://aspdotnetmania.blogspot.com

When I first started using Asp.Net Ajax toolkit, I found there is a very fundamental requirement from lot of developers where we want to have some kinds of control on the client side without triggering the service side event.

Asp.net Code is Like below::



<asp:Panel runat="server" ID="pnlDemo" style="display:none">

<h1>This panel is a test demo</h1>

</asp:Panel>


<cc1:ModalPopupExtender ID="ModalPopupExtender" runat="server" TargetControlID="linkButton1"

PopupControlID="pnlDemo"

BackgroundCssClass="modalBlockBackground" BehaviorID="ModalPopupExtender"

DynamicServicePath="" Enabled="True">

</cc1:ModalPopupExtender>



Javascript Code is like Below. ::


if(!show)
{
$find('ModalPopupExtender').hide();
}
else
{
$find("ModalPopupExtender").show();
}


Comments

Guest Author: B Kumar23 Feb 2013

Nice Example!!!!



  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name:
    Email: