473,388 Members | 1,198 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

Button open a new page

Hi everyone
I have a button that open a new web page so i use the following script
response.write("<script>window.open(url,'Name')</script>")
every time the user click on the button it opens a new page
How to make sure that if the user open a page & click again on the button it
doesent open another one as long as the page is already opened??????????
Thx & Regards
Nov 18 '05 #1
2 5222
When you submit your form, you're breaking the ownership chain between the
form and the window that you named 'Name'. Therefore, when you run your
script again, it has no knowledge of the window named 'Name'.

If you did this entirely in HTML controls and on the client side, it would
work as expected.

Dale Preston
MCAD, MCSE, MCDBA

"Mariame" <Ma************@yahoo.com> wrote in message
news:u6**************@TK2MSFTNGP11.phx.gbl...
Hi everyone
I have a button that open a new web page so i use the following script
response.write("<script>window.open(url,'Name')</script>")
every time the user click on the button it opens a new page
How to make sure that if the user open a page & click again on the button it doesent open another one as long as the page is already opened??????????
Thx & Regards

Nov 18 '05 #2
Mariame,
Add a button and a label to a form and try the following code to the
buttons click event
Jared

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim urls() As String = New
String("http://www.microsoft.com,http://www.google.com,http://www.amazon.com,http://www.yahoo.com").Split(",")

Select Case Me.Label1.Text
Case 0 To 3
Me.Label1.Text += 1
Case Else
Me.Label1.Text = 0
End Select

Dim URL As String
If Me.Label1.Text >= 4 Then
Me.Label1.Text = 0
End If
URL = urls(Me.Label1.Text Mod 4)

Dim MyScript As New System.Text.StringBuilder
With MyScript
.Append("<script language=""javascript"">")
.Append("window.open('" & URL & "','Name');")
.Append("</script>")
End With
Page.RegisterStartupScript("SingleWindow", MyScript.ToString)
End Sub

"Mariame" <Ma************@yahoo.com> wrote in message
news:u6**************@TK2MSFTNGP11.phx.gbl...
Hi everyone
I have a button that open a new web page so i use the following script
response.write("<script>window.open(url,'Name')</script>")
every time the user click on the button it opens a new page
How to make sure that if the user open a page & click again on the button
it
doesent open another one as long as the page is already opened??????????
Thx & Regards

Nov 18 '05 #3

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

Similar topics

5
by: TrvlOrm | last post by:
Can any one please help me...I am new to JavaScript and I have been struggling with this code for days now and can't figure it out. I would like to get the Buttons to correspond with the action...
14
by: tshad | last post by:
I posted this on the asp.net group, also. I wasn't sure whether this was an asp.net problem or a javascript problem. I have a page that was originally created from a program I found on the net...
25
by: KK | last post by:
Hi, I am using history.go(-1) for implementing the back button functionality. Its working fine but with this exception. 1. The page which is having back button has some hyperlinks on it. ...
7
by: IntraRELY | last post by:
I am using the following command to launch and .NET VB Executable, which is a simple Windows Form (printCheckClient.exe). I am using a HyperLink Control and works perfect....
3
by: IntraRELY | last post by:
I need to attach the following 2 little scripts to an ASP.NET Button. I am having an issue with running both of the Attributes.Add. I can only get on to work at once. I have also tried to put them...
4
by: Carlo Marchesoni | last post by:
I have a button that opens a new Window (some kind of search-window), which is fired using JavaScript (btnSearch.Attributes=".....";) Now I need to run some code behind code BEFORE this JavaScript...
2
by: COHENMARVIN | last post by:
I am working on an application where the user enters info into a multiline textbox. The info is Stylesheet tags that he wants web pages to use. Basically he would be entering a stylesheet into...
9
by: Neo Geshel | last post by:
I have strip-mined, strip-searched, and completely exhausted the Internet (up to the 30th page on Google, with 100 results per page!!), all without finding an answer to my question AS TO WHY IT...
0
by: Ty | last post by:
I have a page that has three gridviews on it. In each gridview the first column is a link button representing a Database ID field. What I'm trying to accomplish is to email that page and click on...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
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...
0
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...

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.