[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1964
  • Last Modified:

MouseOver on AJAX ModalPopupExtender - ASP.Net

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
0
jr_bautista
Asked:
jr_bautista
1 Solution
 
aibusinesssolutionsCommented:
You would need the following javascript:

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

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=
0
 
CB_ThirumalaiCommented:
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();");
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
jr_bautistaAuthor Commented:
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)"  />
 
Extender:
<cc1:ModalPopupExtender ID="ModalPopupExtender1" runat="server" 
            TargetControlID="job1" PopupControlID="pnlPopup1"  CancelControlID="btnCancel" 
            OkControlID="btnOK" BackgroundCssClass ="modalBackground">            
             </cc1:ModalPopupExtender> 
 
<cc1:RoundedCornersExtender ID="RoundedCornersExtender1" runat="server" 
           TargetControlID="pnlInnerPopup1" BorderColor="white" Radius="10" />        
 
Javascript:
 
<script language="javascript" type="text/javascript"> 
  function showModalPopupViaClient(control,id) {                 
            var modalPopupBehavior = $find('ModalPopupExtender1');
            modalPopupBehavior.show();                    
              
        }
 
</script>

Open in new window

0
 
aibusinesssolutionsCommented:
I think the function is _show(), not show()
0
 
jr_bautistaAuthor Commented:
I got it! Since my page is in master page I added the ctl00_ContentPlaceHolder1_ to find it.

Thank you all...
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now