Results 1 to 4 of 4

Thread: [RESOLVED] Kind of MVC probably JavaScript/JQuery Question

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Feb 2000
    Location
    Dunmow,Essex,England
    Posts
    898

    Resolved [RESOLVED] Kind of MVC probably JavaScript/JQuery Question

    HI All,

    I am developing an MVC3 App. What I want to do is while the browser is open on my Application, I want to stop the user from switching to other windows can anybody recommend a way of doing this.

    In classic asp you used to be able to get away with a hack something like:

    <body onblur="self.focus();">

    but under MVC this really screws the browser. does anybody have any other ideas.

  2. #2
    PowerPoster Evil_Giraffe's Avatar
    Join Date
    Aug 2002
    Location
    Suffolk, UK
    Posts
    2,555

    Re: Kind of MVC probably JavaScript/JQuery Question

    Given that that would be entirely client side, the use of classic ASP vs ASP.NET MVC seems somewhat tangential to the issue. Is it perhaps a more modern browser at fault rather than the server-side rendering technology?

    Another question is what kind of pig-headed arrogant web application are you developing that you think preventing users switching to a different window on their desktop is in anyway acceptable?

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Feb 2000
    Location
    Dunmow,Essex,England
    Posts
    898

    Re: Kind of MVC probably JavaScript/JQuery Question

    Evil_Giraffe....You dont need to be so rude.

    It's not my application but a client I am workinig for and it's what they want. The application will be an extranet app that has financially sensitive info on it that also needs to be completed from start to finish. They want to ensure that while the users are using this app they do not get side tracked to other work.

  4. #4
    Serge's Avatar
    Join Date
    Feb 1999
    Location
    Scottsdale, Arizona, USA
    Posts
    2,744

    Re: Kind of MVC probably JavaScript/JQuery Question

    Unfortunately you cannot prevent the user from switching to other browsers, tabs. The only client-side event that exists is onBlur, but it doesn't work 100&#37;, this event doesn't always fire when you close the browser window. The closest thing you can get is if you write your application in SilverLight but even with SilverLight you cannot prevent the user from switching to other tabs/browsers. The only thing you can do is to show them some kind of a message box, telling them to come back.

Posting Permissions

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



Click Here to Expand Forum to Full Width