Utilize JavaScript to Trigger AJAX HoverMenuExtender in .NET

Within my C# web application,

I am attempting to trigger an Ajax HoverMenuExtender using JavaScript, rather than relying on hovering over a designated control.

When I set the TargetControlID of the HoverMenuExtender to a control on the page and hover over it with the mouse, the hover menu appears; however, I am unable to make it display by manually invoking it with JavaScript.

The current JavaScript code I am experimenting with:

popup = $("body").find('HME1');
popup.show();
//popup._popupBehavior.show();

I have debugged the code and verified that popup.show() is being executed. Yet, it seems like nothing happens. It appears that .Show may not be the correct method, and we may need to "Invoke" the AjaxExtender in a different way.

The HoverMenuExtender setup:

<cc1:HoverMenuExtender ID="HME1" runat="server"  BehaviorID="HME1" TargetControlID="dummyLink" PopupPosition="Top" PopupControlID="PopupMenu"></cc1:HoverMenuExtender>

A dummy link where I assign the control ID:

<a href="#" style="display:none;visibility:hidden;" onclick="return false" ID="dummyLink" runat="server">dummy</a>

The panel I am aiming to show:

<asp:Panel CssClass="popupMenu" ID="PopupMenu" 
    runat="server">
    <asp:LinkButton ID="article" runat="server" 
        CommandName="Edit" Text="Edit" />
    <br />
    <asp:LinkButton ID="LinkButton2" runat="server" 
        CommandName="Delete" Text="Delete" />
</asp:Panel>

Answer №1

Here is the code you need:

Call this function to display the popup behavior: $find("BehaviourID")._popupBehavior.show();

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

What is the best way to fill in fields on my webpage using a dropdown menu choice?

I'm exploring the world of ASP.NET MVC, AJAX, and jQuery for the first time. I'm attempting to populate some text boxes on my website based on a dropdown selection but it seems like the data isn't getting through. I suspect that the 'ch ...

Extract content from an HTML form within a specific cell using Cheerio

A sample HTML table is displayed below: <tr class="row-class" role="row"> <td>Text1</td> <td> <form method='get' action='http://example.php'> <input type='hidden' ...

Is it necessary for material-ui useStyles to use the entire props object?

Perusing through the documentation, it suggests that in order for our component to accommodate style overrides using classes, we are advised to provide the entire props object to the useStyles hook: function Nested(props) { const classes = useStyles(prop ...

"Encountered an unexpected token in Javascript - jsp error

Recently, I started working on a JSP application and encountered an issue with passing URL variables from a servlet to a JSP page using request.getattribute. When trying to pass the data to a JavaScript function, we received the following error: Uncaught ...

A guide on adding a personal library to Ember using npm

Despite the abundance of blog posts discussing it, I am still facing challenges in utilizing a custom library as a dependency for my ember application through npm. I have developed a WebGL library and successfully imported it into my Ember app by installi ...

What is the most effective method for serializing SVG data from the client's Document Object Model (DOM

As I delve into the world of creating interactive SVG/AJAX interfaces, I find myself faced with a challenge. Users are constantly manipulating elements on-the-fly and I want to give them the option to export their current view as a PNG image or an SVG docu ...

Transform the data into put and choose the desired item

Here is the data I am working with "dates": { "contract": [ {"id":1,"name":"1 month","value":false}, {"id":2,"name":"2 months","value":true} ] } I want to display this data in a select dropdown on my HTML page. Here is what I have tried s ...

Tips on adding a watermark to multi-page PDFs using an image as the watermark

I am currently working on embedding a watermark onto every page of a PDF file using the image-watermark library. So far, I have successfully added a text watermark to files with only one page but now I am exploring ways to extend this functionality for mul ...

Can an in-progress NPM package be tested using NPX?

I am currently developing an NPM package that is designed to be used exclusively through npx *, similar to packages like create-nuxt-app. Is there a method to test my package using npx *? Essentially, I want to run my bin script without actually installin ...

What is the best way to extract text from a list item in an unordered list (

I am trying to search a ul list that populates a ddSlick dropdown box. ddSlick adds pictures to list items, making it a visually appealing choice. To see more about ddSlick, you can visit their website here: Here is the code I am using to loop through the ...

Decoding various JSON arrays received through AJAX requests

After returning two objects as JSON through AJAX, I am facing an issue with accessing the values in these two lists. Previously, when I had only one list, I could parse it easily. data = serialize("json", vm_obj) data2 = serialize("json", user_networks_li ...

Leveraging Scrapy/Selenium for populating fields and conducting searches on LinkedIn's advanced search page

Discover the URL for LinkedIn's advanced search feature: In my attempt to complete fields and submit a form on the LinkedIn advanced search page using Selenium with Python, I encountered a challenge. Whenever I try typing in information for fields l ...

Tips for displaying a restricted quantity of items in a list according to the number of li lines used

My approach involves using a bulleted list to display a limited number of items without a scrollbar in 'UL' upon page load. On clicking a 'more' button, I aim to reveal the remaining items with a scrollbar in UL. The following code acco ...

Accessing WCF service through various domain clients

Utilizing a WCF service, I have successfully accessed it from Javascript using AJAX and JSON. Both the client and service are located on the same domain, which has been working well. Now, I am faced with the challenge of calling the same service from mult ...

Converting an HTML Division (including tags and Hindi Unicode characters) to a PDF using ASP.NET C#

I am facing difficulties in converting HTML <div> with content written in Hindi (Unicode characters) to PDF in ASP.NET using C#. Despite trying various third-party HTML to PDF conversion tools like nReco, evopdf, hiqpdf, none of them seem to work p ...

In search of innovative strategies to securely implement this

After conducting thorough research on StackOverflow and .NET, I am still unable to come up with a practical solution or may have overlooked something. I am working on an application that requires writing a document to disk on the web server as part of its ...

Make sure to blur all images whenever one of them is clicked

I am currently facing an issue with my webpage where I have 3 images displayed. I have implemented an event listener to detect clicks on the images, and once a click occurs on one of them, I want everything else on the page to become blurred, including the ...

Incorporate HTML elements into a React component

Is there a way to render (move) a DOM element into a React Component? I am facing a situation where I have integrated a third-party script into my React project (such as incorporating a live chat widget with a script). This script generates a DOM node when ...

Group the elements of the second array based on the repeated values of the first array and combine them into a single string

I have a challenge with two arrays and a string shown below var str=offer?; var names = [channelId, channelId, offerType, offerType, Language]; var values =[647, 763, international, programming, English]; Both arrays are the same size. I want to creat ...

Problem encountered when trying to load JSON data using ajax

I encountered the following issue : SyntaxError: missing ; before statement {"users":[{"name":"A Lindsay","active":true,"id":"","login":"alindsa This is how the JSON data appears: { "users": [{ "name": "A Lindsay", "active": tr ...