Posted on 2011-05-10
Last Modified: 2012-05-11
I have a user control, say UC, with splitter control that divides the form like |--.
The right bottom portion loads controls based on the user selections on the left side.

I have attached a Application.AddMessageFilter that captures the MOUSEMOVE messages in UC constructor.

While the user is acitve on UC my application keeps renewing logout time.
If the mouse stops moving on UC then it logs the user out after 30 secs of inactivity...

When I host the above user control UC inside a Win Form everything works fine. But when I host the same UC inside an internet explorer using OBJECT tag, MOUSEMOVE is not working correctly:: Eventhough I am moving the mouse, it fails to renew the user logout time but instead acts like it is not seeing the MOUSEMOVE events...and simply logs out the user.

HOW TO FIX this??


Question by:YetAnotherCoder
    LVL 10

    Expert Comment

    by:John Claes

    because everything is done at the codebehind the WinForm will work correcly because OnMouseMove will call the presenter (codebehind) and the mouse move is "seen" and "processed"

    because in an ASP the CodeBehind is ServerSide and so for every CodeBehind Execution an Server-Call must be done.
    On every mouse move you should then send the call towards the server and this will issue a real hugh bunch off calls.
    That's why the MOUSEMOVE is not working linked to CodeBehind Calls

    Poor beggar.

    Author Comment

    Hi Poor beggar,

    What is the best way to get it working then. Is there a JavaScript alternative that I can use when the mouse is over user control, UC, and call the control function via the java script. How effective will it be? Atleast it will handled locally and not at the server?
    LVL 10

    Accepted Solution

    you can indeed use the Javascripts to catch the mouse moves.
    Everything will be kept Client Side. because JavaScript runs clientside.

    But when needed you can call a action on the screen that will fire a PostBack handling towards the server.

    poor beggar

    Author Comment

    Hi poor beggar,

    As I have another discussion on another thread
    I have tried using JavaScript OnMouseMove event on a DIV tag to call the function inside the user control. It works until I display a popup dialog originated inside the control. Once the dialog is displayed and closed, the OnMouseMove event does not work anymore until the mouse is taken off of the control and bring it back OR until a right click on the control. How to avoid moving mouse out of the control or right click and make it work??

    Thanks for any ideas... You can add to that thread...
    LVL 10

    Expert Comment

    by:John Claes
    I've done that.
    is this question closed?

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Course: HTML5 Specialist

    HTML5 development skills are critical to all developers. HTML5 is the foundation to almost any development process. That's why business, design studios, development shops and other organizations need HTML5 developers. Get your foot in the door as a HTML5 specialist.

    I had to do a bit of research to find the answer to this question so I thought I'd share my results.  Due to our outdated mainframe systems, we need to downgrade IE9 to IE8 in order to stay compatible.  We also needed to downgrade Java.  In order to…
    I recently found myself in a Corporate Situation where the client had requested blocking access to any and all websites except his own Domain? Easy? I am sure this would be your answer but their requirement was, this has to be done without using…
    This Micro Tutorial will demonstrate how to add subdomains to your content reports. This can be very importing in having a site with multiple subdomains.
    How to create a custom search shortcut to site-search Experts Exchange using Google in the Firefox browser. This eliminates the need to type out whenever you want to search the site. Launch your Bookmark Menu: Press 'Ctrl +…

    760 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

    11 Experts available now in Live!

    Get 1:1 Help Now