473,761 Members | 8,463 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Open new browser session

I have a button on my web app, that opens a help html page. I use this code:
HttpContext.Cur rent.Response.W rite("<script>" )
HttpContext.Cur rent.Response.W rite("window.op en('" & sUrl & "','_new')" )
HttpContext.Cur rent.Response.W rite("</script>")

This works ok, the html page opens in a new browser window, but when I
close the help, click on a different menu item in my app, and then click the
back button, the help window opens up again.

How do I do a Response.Write, that isn't on HttpContext.Cur rent? I have
also tried _blank

Thanks, Leonard
Oct 19 '05 #1
3 3142
Leonard,

You put window.open(url ) in the document - and it executes every time the
document is loaded. If you need to open new window when a button is clicked -
just add "onclick" attribute for your button:
MyButton.Attrib utes.Add("oncli ck", "window.ope n('" & sUrl & "','_new')" )

"Leonard" wrote:
I have a button on my web app, that opens a help html page. I use this code:
HttpContext.Cur rent.Response.W rite("<script>" )
HttpContext.Cur rent.Response.W rite("window.op en('" & sUrl & "','_new')" )
HttpContext.Cur rent.Response.W rite("</script>")

This works ok, the html page opens in a new browser window, but when I
close the help, click on a different menu item in my app, and then click the
back button, the help window opens up again.

How do I do a Response.Write, that isn't on HttpContext.Cur rent? I have
also tried _blank

Thanks, Leonard

Oct 20 '05 #2
Hi Sergey,
The new window opens ok with the code I have, but it opens on the current
context, so when I press the back button, the new url opens again. I want
the window to open, then when I close it, it is gone and is not re-opened
when I press the back button on the browser

"Sergey Poberezovskiy" wrote:
Leonard,

You put window.open(url ) in the document - and it executes every time the
document is loaded. If you need to open new window when a button is clicked -
just add "onclick" attribute for your button:
MyButton.Attrib utes.Add("oncli ck", "window.ope n('" & sUrl & "','_new')" )

"Leonard" wrote:
I have a button on my web app, that opens a help html page. I use this code:
HttpContext.Cur rent.Response.W rite("<script>" )
HttpContext.Cur rent.Response.W rite("window.op en('" & sUrl & "','_new')" )
HttpContext.Cur rent.Response.W rite("</script>")

This works ok, the html page opens in a new browser window, but when I
close the help, click on a different menu item in my app, and then click the
back button, the help window opens up again.

How do I do a Response.Write, that isn't on HttpContext.Cur rent? I have
also tried _blank

Thanks, Leonard

Oct 21 '05 #3
Leonard,

not sure what you mean, but if you want to prevent the same window from
loading once you navigated to another page, you can store the values whether
you opened or not your window in a hidden field (let's say on document unload
event) and then read that value during load event and then decide whether to
open or not your help window. I used similar techique to prevent a form from
multiposting when user clicks on "Back" or History link.

HTH

"Leonard" wrote:
Hi Sergey,
The new window opens ok with the code I have, but it opens on the current
context, so when I press the back button, the new url opens again. I want
the window to open, then when I close it, it is gone and is not re-opened
when I press the back button on the browser

"Sergey Poberezovskiy" wrote:
Leonard,

You put window.open(url ) in the document - and it executes every time the
document is loaded. If you need to open new window when a button is clicked -
just add "onclick" attribute for your button:
MyButton.Attrib utes.Add("oncli ck", "window.ope n('" & sUrl & "','_new')" )

"Leonard" wrote:
I have a button on my web app, that opens a help html page. I use this code:
HttpContext.Cur rent.Response.W rite("<script>" )
HttpContext.Cur rent.Response.W rite("window.op en('" & sUrl & "','_new')" )
HttpContext.Cur rent.Response.W rite("</script>")

This works ok, the html page opens in a new browser window, but when I
close the help, click on a different menu item in my app, and then click the
back button, the help window opens up again.

How do I do a Response.Write, that isn't on HttpContext.Cur rent? I have
also tried _blank

Thanks, Leonard

Oct 24 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

18
8846
by: Paul | last post by:
I link to a web site from an Excel spreadsheet. The page i link to is getCookie.asp which sets a cookie then returns back some html which opens a new window, to the same site but a different page (same folder). The cookie is not received. Can someone explain why? I worked around this by adding a cache-control header with a value of no-cache. This fixes the problem. Unfortunately that causes another problem with Internet Explorer...
4
3382
by: google | last post by:
Hi there, I've searched high and low for this, but it seems most people are looking to establish (and control) the relationship between a parent browser window and it's associated child window created with window.open. I would like to break this connection. Why? Because there is an application that I want to open in a new window, but no matter what I do it will close the window and redirect the original (parent) window to its location...
5
8710
by: John Scott | last post by:
Ok..this a rather odd question/problem. I haven't really found a straight forward answer to how to handle this scenario, so I hope someone here can help. Here it is: I have an application that allows users to log in. Each user can have multiple roles within the application. Each role allows the user to access different sections of the app and allows/denies them certain functionality.
4
7861
by: Gunawan | last post by:
Dear All, I would like to know how to disable 'open in a new tab' or 'open in a new window' feature coz I would like to maintain parameter using session id which is not change if we using those two feature. In fact I would like to make my web application stay on one web browser windows during the session. Regards, Gun
9
2815
by: cendrizzi | last post by:
Hi all, I've read some stuff on this but can't seem to come up with a solution that works right. I have a semi-mature (yet very large and robust) internal web application that currently only works with one window open at a time. Maybe I'm abusing the use of $_SESSION but I have data entry processes split up in several steps (which is required since depending on what was put before determines what pages will be shown after). To store...
8
11003
by: jaibux | last post by:
Everybody knows how to open (or clone) the same page that you are viewing in a new browser window by CTRL+N or via File->New Window. the question is how to PREVENT to open the SAME WEB APPLICATION (with the same session) in two or more browser windows. any ideas? jaibux@gmail.com
6
2409
by: =?Utf-8?B?YzY3NjIyOA==?= | last post by:
Hi all, I am thinking about doing this since I got several cases that some of our internal users open more than one browser at the same time from our server. When one of the transactions was not completed finished, the second browser jusk pick up some session variables from the first browser and process right after that. It messed up everything. I was thinking about use remote_addr, but it seems not working since we are behind the...
20
3195
by: luqman | last post by:
If user login with the login control in ASP.Net 2005 and then just close the browser and then open the browser again, the login status shows, User still Login? Any idea, how to Logout the User when the User click on the Close Button of Browser ? I am using Sql Membership Provider for security. Best Regards,
3
2652
by: Tomasz J | last post by:
Hello Developers! A lot has been written about Java Script window.open() function and lost session state. But the most recent version of IE seems to handle it correctly. But now I have an opposite problem: how to open a new browser window so it *does not* share the session state with the first (parent) window? I have a web application which must open a new popup window, but new session
0
9336
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10111
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9948
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9902
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7327
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6603
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5215
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5364
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
3446
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.