473,698 Members | 2,376 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

window.open -- how to keep original page

Hello,

I have a link on an aspx page. The URL is set in the Page Load event:

lnkEventHistory .NavigateUrl =
"javascript:win dow.open('Event History.aspx?Te enID=" & _
Request.Item("S ubjectID") & "&EventCode =" &
Request.Item("E ventCode") & "')"

When I click the link, the new window opens as expected. The problem is
that on the original page containing the link, everything disappears and is
replaced with just this:

[object]

Can anyone tell me why this is happening and how I can keep the original
page intact while popping up the new window?

Thanks very much.
Nov 19 '05 #1
5 2529
Output a standard HTML anchor tag with the Target attribute specified.
<a href="EventHist ory.aspx" target='_blank' >click me</a>

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net

"Chris" <Ch***@discussi ons.microsoft.c om> wrote in message
news:8C******** *************** ***********@mic rosoft.com...
Hello,

I have a link on an aspx page. The URL is set in the Page Load event:

lnkEventHistory .NavigateUrl =
"javascript:win dow.open('Event History.aspx?Te enID=" & _
Request.Item("S ubjectID") & "&EventCode =" &
Request.Item("E ventCode") & "')"

When I click the link, the new window opens as expected. The problem is
that on the original page containing the link, everything disappears and
is
replaced with just this:

[object]

Can anyone tell me why this is happening and how I can keep the original
page intact while popping up the new window?

Thanks very much.

Nov 19 '05 #2
Thank you for your reply. I'm still wrestling with this. Let me give some
more background.

I tried two things based on your suggestion:

1) I created a label on the form. On the Page Load event, I set the text of
the label to this:

lblEventHistory Link.Text = "<a href='EventHist ory.aspx?TeenID =" &
Request.Item("S ubjectID") & "&EventCode =" & Request.Item("E ventCode") & "'
target='_blank' >View Event History</a>"

This sort of worked, except that I need to use Javascript's window.open
method so that I can set the new window's size, menubars, etc.

2) Second thing I tried -- On my original hyperlink, which is an ASP Web
control, I set the Target to "_blank" in the Properties window. When I run
it and click the link, I get two new windows:

- The first is a blank page that has the text "[object]" in it. The
address bar says:
javascript:wind ow.open('EventH istory.aspx?Tee nID=123&EventCo de=10')

- The second window is the page that I actually want.

Is there any way to get rid of this intermediate "[object]" window?

Any other ideas I can try?

Thanks.

"Steve C. Orr [MVP, MCSD]" wrote:
Output a standard HTML anchor tag with the Target attribute specified.
<a href="EventHist ory.aspx" target='_blank' >click me</a>

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net

"Chris" <Ch***@discussi ons.microsoft.c om> wrote in message
news:8C******** *************** ***********@mic rosoft.com...
Hello,

I have a link on an aspx page. The URL is set in the Page Load event:

lnkEventHistory .NavigateUrl =
"javascript:win dow.open('Event History.aspx?Te enID=" & _
Request.Item("S ubjectID") & "&EventCode =" &
Request.Item("E ventCode") & "')"

When I click the link, the new window opens as expected. The problem is
that on the original page containing the link, everything disappears and
is
replaced with just this:

[object]

Can anyone tell me why this is happening and how I can keep the original
page intact while popping up the new window?

Thanks very much.


Nov 19 '05 #3
I just tried a third idea. I added the window.open to the href in the
standard HTML anchor, like this:

Dim strhref As String
strhref = "javascript:win dow.open('Event History.aspx?Te enID=" & _
Request.Item("T eenID") & "&EventCode =" &
Request.Item("E ventCode") & "')"
lblEventHistory Link.Text = "<a href=""" & strhref & """
target=""_blank "">View Event History</a>"

I'm getting the same behavior as with the ASP Web control hyperlink -- an
intermediate window containing only the text "[object]" opens in addition to
the final desired window.

So I don't think the problem is with the standard HTML anchor versus the ASP
Web control hyperlink. There must be some subtlety of Javascript that I am
missing.

Can anyone help me?
"Chris" wrote:
Hello,

I have a link on an aspx page. The URL is set in the Page Load event:

lnkEventHistory .NavigateUrl =
"javascript:win dow.open('Event History.aspx?Te enID=" & _
Request.Item("S ubjectID") & "&EventCode =" &
Request.Item("E ventCode") & "')"

When I click the link, the new window opens as expected. The problem is
that on the original page containing the link, everything disappears and is
replaced with just this:

[object]

Can anyone tell me why this is happening and how I can keep the original
page intact while popping up the new window?

Thanks very much.

Nov 19 '05 #4
You need to execute two lines of javascript:

Window.Open(... );
Document.locati on='page2.aspx' ;

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net
"Chris" <Ch***@discussi ons.microsoft.c om> wrote in message
news:12******** *************** ***********@mic rosoft.com...
I just tried a third idea. I added the window.open to the href in the
standard HTML anchor, like this:

Dim strhref As String
strhref = "javascript:win dow.open('Event History.aspx?Te enID=" & _
Request.Item("T eenID") & "&EventCode =" &
Request.Item("E ventCode") & "')"
lblEventHistory Link.Text = "<a href=""" & strhref & """
target=""_blank "">View Event History</a>"

I'm getting the same behavior as with the ASP Web control hyperlink -- an
intermediate window containing only the text "[object]" opens in addition
to
the final desired window.

So I don't think the problem is with the standard HTML anchor versus the
ASP
Web control hyperlink. There must be some subtlety of Javascript that I
am
missing.

Can anyone help me?
"Chris" wrote:
Hello,

I have a link on an aspx page. The URL is set in the Page Load event:

lnkEventHistory .NavigateUrl =
"javascript:win dow.open('Event History.aspx?Te enID=" & _
Request.Item("S ubjectID") & "&EventCode =" &
Request.Item("E ventCode") & "')"

When I click the link, the new window opens as expected. The problem is
that on the original page containing the link, everything disappears and
is
replaced with just this:

[object]

Can anyone tell me why this is happening and how I can keep the original
page intact while popping up the new window?

Thanks very much.

Nov 19 '05 #5
Hello Chris,
lnkEventHistory .NavigateUrl =
"javascript:win dow.open('Event History.aspx?Te enID=" & _
Request.Item("S ubjectID") & "&EventCode =" &
Request.Item("E ventCode") & "'); return false"
Note the addition of the 'return false'. This instructs the browser to stop
processing.

--
Matt Berther
http://www.mattberther.com
Hello,

I have a link on an aspx page. The URL is set in the Page Load event:

lnkEventHistory .NavigateUrl =
"javascript:win dow.open('Event History.aspx?Te enID=" & _
Request.Item("S ubjectID") & "&EventCode =" &
Request.Item("E ventCode") & "')"
When I click the link, the new window opens as expected. The problem
is that on the original page containing the link, everything
disappears and is replaced with just this:

[object]

Can anyone tell me why this is happening and how I can keep the
original page intact while popping up the new window?

Thanks very much.

Nov 19 '05 #6

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

Similar topics

10
14715
by: Scott | last post by:
I'm new to ASP, but I've been programming in VB for several years, and I'm having a few issues with this ASP enhancement I'm working on. I've found ASP to be a lot different than what I'm use to in VB. I've created an ASP interface where a user can select an email group that populates a listbox with those email addresses. If a user sees an email in that list that they do not want then they can remove it by clinking the Delete button...
12
12429
by: HarveyB | last post by:
I would like to generate non-modal popup windows from ASP.Net code-behind. I have tried using Client Side scripting like "function Test(){ window.open('test.htm',_blank, 'height=200,width=400,status=no,toolbar=no, menubar=no,location=no resizable=no scrollable=no'); but I can't seem to invoke the client side script from within a Server Side Form. I know I can use the context with to Response.redirect or Server.transfer to return a
4
2199
by: Dan Cruz | last post by:
Below are two files: Main.asp and Help.asp. I've stripped it down to the 'barest-of bones' so that anyone willing to help can duplicate the problem on their own systems. ***Main.asp*** looks like so: <HTML> <HEAD> <TITLE>Main</TITLE>
19
31051
by: Darren | last post by:
I have a page that opens a popup window and within the window, some databse info is submitted and the window closes. It then refreshes the original window using window.opener.location.reload(). The problem is that after the reload, it brings you right to the top of the page. When I click 'refresh" on the original page, it brings me back to the original viewing position. Is there a way to duplicate this in from the popup window. Also,...
14
11086
by: D. Alvarado | last post by:
Hello, I am trying to open a window containing an image and I would like the image to be flush against the window -- i.e. have no padding or border. Can I make this happen with a single call to a window.open function? I would prefer not to create a separate HTML page. So far all I have is the basic var cwin = window.open('images/KJV-THANKS.gif', 'Thanks', 'width=243,height=420,'); cwin.focus();
2
12555
by: Matt | last post by:
When we submit the form data to another page, we usually do the following: <form action="display.aspx" method="post"> will submit the form data and open display.asp in the current browser <form action="display.aspx" method="post" target="_blank"> will submit the form data and open display.asp in a new browser
3
29106
by: hb | last post by:
Hi, I have a asp:button btnGo. When clicking this button, the code will parse a asp:table to find a specific ID under certain conditions. Once the ID is found, the code need to keep the current page open and to redirect the user to a newly opened browser window with a link like: http://www.mydomain.com/tellme.aspx?clientID="+ID But the Response.Redirect(URL) opens a new page in the same
7
2857
by: MrFez | last post by:
Through some investigation it appears that selecting "Every visit to the page" for the IE caching setting "Check for new version of stored pages" causes the window.opener property of child windows to be set to null after the main page has excuted a postback. Can anyone explain this or at show that I'm wrong ? Is this a bug in IE ?
4
6404
by: alexandre.brisebois | last post by:
Hi, I am using access 2003, I would like to know if there is an option to reorganize the tables in a maner that is readable, as we can do in sql sever 2000 or 2005. I have been given a database to look a and I am loosing tremendious amounts of time trying to organize it so that I could view it. Regards, Alexandre Brisebois
0
8676
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9029
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
8897
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
6522
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
5860
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
4370
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
4619
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3050
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2006
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.