CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2013

    Timer in master page is affecting dropdown elements in master and content pages

    I'm updating an image in an UpdatePanel in my master page using a asp:timer and some code behind to randomly switch images every 5 seconds. This works well, but the timer's tick event that I use for switching images seems to interfere with a dropdown in a content page. For example, while attempting to make a selection in a dropdown, the tick event will collapse the dropdown and I have to drop it down again and make the selection quickly before the next tick event closes it again. Same behavior occurs in the main menu, where a main menu item that is opened to show submenu items closes on the timer event.

    In the master page, I have tried scoping the update panel to include the content page, as well as scoping it tightly to the image element only, and the behavior is the same. Would appreciate any advice on what's causing the issue and what can be done. Thanks.

  2. #2
    Join Date
    Jun 2005
    JHB South Africa

    Re: Timer in master page is affecting dropdown elements in master and content pages

    Any action on the ASP is considered user action (the timer tick triggers events just like a user click would), so the browser will collapse the menu because it thinks the user has now clicked the image...

    Two choices.

    #1: Pause the timer when the drop down is active..

    #2: Use Flash to switch the images (generally accepted method to do image rotations)
    Articles VB6 : Break the 2G limit - Animation 1, 2 VB.NET : 2005/8 : Moving Images , Animation 1 , 2 , 3 , User Controls
    WPF Articles : 3D Animation 1 , 2 , 3
    Code snips: VB6 Hex Edit, IP Chat, Copy Prot., Crop, Zoom : .NET IP Chat (V4), Adv. ContextMenus, click Hotspot, Scroll Controls
    Find me in ASP.NET., VB6., VB.NET , Writing Articles, My Genealogy, Forum
    All VS.NET: posts refer to VS.NET 2008 (Pro) unless otherwise stated.

  3. #3
    Join Date
    Feb 2013

    Re: Timer in master page is affecting dropdown elements in master and content pages

    Thanks for the reply... I'm seeing that timer events and code behind are not really the best way to switch images. I'm now looking into doing it with javascript... will update once I've got something working.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Windows Mobile Development Center

Click Here to Expand Forum to Full Width

On-Demand Webinars (sponsored)

We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.