简体   繁体   中英

web application in two browser windows (ASP.NET MVC)

We are building an ASP.NET MVC web application for internal use within our company. Due to the nature of the business, our users can be much more productive if we give them a lot of screen space. Our plan is to give each user two 24" monitors, and design the pages of the application accordingly. We would like to use two browser windows for the two monitors.

  • The main window with the input forms (left hand side)
  • The viewer window where attached documents can be shown (right hand side)

When the user makes a certain change in the main window, I would like to re-render the viewer window by setting a new URL there. But how can I make the viewer window load a new page in the case of an event in the main window? To be precise, I want the viewer window to load the same page but with changed parameters (different document ID) in the URL.

I recommend looking into SignalR

Here is more information

http://www.asp.net/signalr

It's a way to send signals to the client from the server, to update information.

Edit :

After thinking about it, it's much too simple of a case to use signalR.

In javascript you can use window.open to open a new window. When you do, you can give that window a name.

More info on window.open

What this does is update the window if it's already open, or opens the window if it's not open yet.

Here is a simple sample of this.

$(function () {
    $("#btnGoogle").click(function () {        
        window.open("http://www.google.com", "testChildWindow");
    });
    $("#btnBing").click(function () {
        window.open("http://www.bing.com", "testChildWindow");
    });
});

The downside of this is that the view window will be "bound" to the instance of the main window. So if you have both windows open. Close and reopen the main window, it will open a second instance of view window next time Window.open is called.

I would build this as two separate pages that know nothing about one another. Then let the user open both in separate tabs, on the separate screens. For the output screen I would use SignalR (as Smeegs already mentioned) or ajax to display new information as it becomes available in your system.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM