MouseOver on AJAX ModalPopupExtender - ASP.Net

Posted on 2009-02-10
Last Modified: 2012-05-06
I want to enable a ModalPopupExtender on mouseover on a text. I can do that using  TargetControlID(when text click) but have no idea on mouseover. I'm using Asp.Net
Question by:jr_bautista
    LVL 15

    Expert Comment

    You would need the following javascript:

    function ShowMyModalPopup() {
          var modal = $object('modalPopUpID');
          if (modal) {

    And then on the button or text, or link, just put OnClick="ShowMyModalPopup()"...

    Remember if it's an ASP.NET control you will need to use OnClientClick=
    LVL 12

    Expert Comment

    For mouseover, you can add do this.  For example, if it is a label control then, add an attribute to be fired on the client side on the label control
            <asp:Label ID="lblText" runat="server" Text="Something"/>
    in the server side as,
           lblText.Attributes.Add("onmouseover", "functionname();");
    LVL 15

    Accepted Solution


    Author Comment

    thanks for all your solutions, can't make it run - I attached the code snippet except the Panel. I used both $find and $object

    Button Event:
    <asp:ImageButton ID="detail" runat="server"  onmouseover="showModalPopupViaClient(this)"  />
    <cc1:ModalPopupExtender ID="ModalPopupExtender1" runat="server" 
                TargetControlID="job1" PopupControlID="pnlPopup1"  CancelControlID="btnCancel" 
                OkControlID="btnOK" BackgroundCssClass ="modalBackground">            
    <cc1:RoundedCornersExtender ID="RoundedCornersExtender1" runat="server" 
               TargetControlID="pnlInnerPopup1" BorderColor="white" Radius="10" />        
    <script language="javascript" type="text/javascript"> 
      function showModalPopupViaClient(control,id) {                 
                var modalPopupBehavior = $find('ModalPopupExtender1');

    Open in new window

    LVL 15

    Expert Comment

    I think the function is _show(), not show()

    Author Comment

    I got it! Since my page is in master page I added the ctl00_ContentPlaceHolder1_ to find it.

    Thank you all...

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    Introduction Got endorsements from your clients?  Great!  There is almost nothing better than word-of-mouth advertising.  But how can you do that on the internet?  Sure you can make a page for endorsement quotations and list them all, but who is …
    I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now