Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Check if a specific web page is already open

Status
Not open for further replies.

monkeymagic2222

Technical User
May 13, 2002
78
GB
Hi,

We have a Windows application that lets a user click on a hyperlink which opens a .net web page, passes it an address reference (in a querystring) which is then converted to map coordinates. This page then redirects to another web page running our GIS passing the new map coordinates to it to display the property.

Each time the user clicks on a link from the Windows application, the process is repeated (if the user hasn't closed their web browser) so a new instance of the GIS viewer is opened which can cause performance issues with the GIS System.

Is there a way where I can get my page (the one that converts the address to coordinates) to check if a specific web page is already open and display a message to the user if so?

Thanks,

Simon

 
Nope, not really. How would the server know if some html is sat "open" on a browser?

The only way you could attempt something like this is to put some logic in to only serve the page if there isn't a lock in place (i.e a database value, an application variable etc). However, that opens up a whole new can of worms...



Mark,

Darlington Web Design[tab]|[tab]Experts, Information, Ideas & Knowledge[tab]|[tab]ASP.NET Tips & Tricks
 
I don't see how opening another page causes a memory leak. I would check both the desktop code and the server "GIS" code for leaks.

if your application is opening multiple browsers have the desktop check if a browser is already open. if not, launch a new instance, otherwise open a new tab.

Jason Meckley
Programmer

faq855-7190
faq732-7259
 
Thanks for the feedback. I had a feeling it wasn't something that was straightforward to do.

The problem is I have no control over the desktop or GIS applications, the GIS application is written in such a way that it keeps a session open to the server until the web browser is closed or until a specified timeout and we can't rely on our users to automatically close the web page when they've finished looking at a property.

I had thought of updating a flag in a database but like you say that would probably open a whole new can of worms.
 
Not sure if this will work but have you attempted to name your browser window? From my web page I would use the window.open() javascript method. This takes an url and a window name. If you use that same window name to open a new page it should load in the same window.

A few years ago I created a multi-monitor asp.net app and I "think" this is how I did it (can't find the source at the moment).

I'm not pretending that this is fool-proof but might be something to investigate. I'm also not sure how to do this from a Windows Forms app... man, I'm just full of helpful tips today! ;-)


Regards,

J
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top