Click here to Skip to main content
15,914,608 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
C#
function HideModalPopup()
{
  var modal = $find('mdlpopup');
  modal.hide();
}





XML
<%--<ajaxtoolkit:modalpopupextender runat="server" id="mdlpopup" targetcontrolid="btnoff"
       backgroundcssclass="modalbackground" popupcontrolid="msgpanel" dropshadow="false"
       cancelcontrolid="imgclose2" oncancelscript="hidemodalpopup()" onokscript="hidemodalpopup()"
       okcontrolid="btnok" >
   </ajaxtoolkit:modalpopupextender>--%>
Posted
Comments
Fredrik Bornander 2-Aug-13 4:24am    
wat?

One correction to the above post - $find is not a jQuery function.

$find() is a function from the Microsoft Ajax Core Javascript library. However, it is deprecated now and replaced by jQuery.

There are few methods like $get, $create, $addHandler etc. which were introduced by ASP.Net Ajax library and these functions provide a shortcut to different methods of some classes managed by ASP.Net Ajax. These can be used directly in javascript if you have included Ajax Script Manager in your ASP.Net web application.

For more details please refer : http://www.asp.net/ajax/Documentation/Live/overview/[^]

Now as per your question -
$find('mdlpopup') will find the DOM element having ID 'mdlpopup' in current page.

And, for clearing the confusion with jQuery again-
$(selector).find(target selector); is the syntax for jQuery function but not $find().

I hope this will help you.
Thanks
 
Share this answer
 
$find is selector function in jquery. I will explain with an example:
Check the following code:
XML
<p><span>Hello</span>, how are you?</p>
<p>Me? I'm <span>good</span>.</p>
<script>
  $("p").find("span").css('color','red');
</script>

In this example $find() will return a collection of spans inside every "p" tag and will change the color to red.

Hope it helps you
Happy Coding :)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900