473,725 Members | 1,944 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

using window.open javascript in asp.net

I am currently using response.redire ct in a aspx to go to a web page.
What I want is to open the page in a new window. My dotnet code is as
follows:

Dim sFileName as string = "/TempReports/tempReport.pdf"
response.redire ct(sFileName)

This opens in the same frame and I want to use something like
window.open so I can force a new page and control the size of the
window, etc.... One thing I thought about is calling a javascript
function from within a linkbutton. I don't want to use the
attributes.add because the link button already has code.

I have tried:

Dim scriptString As String = "<script language='javas cript'>
{window.open(" & sFileName & ");} </script>"

Response.Write( scriptString)

but the "<script language=javasc ript></script>" doesn't come across as
a string in my code, it actually comes across as an actual script tag
even though it is in quotes.
I have tried:

Response.Write( "<META HTTP-EQUIV=""REFRESH "" Content=""0;URL =" &
sFileName & """ target=""_blank "">")

to at least get it to open in a new window but I can't get it to work.
Even though I have the target=""_blank "" it still opens in the same
frame.

Any suggestions?
Nov 18 '05 #1
3 9760
I think you have to lose the braces { }, and register the script.

Dim scriptString As String = "<script language='JavaS cript'>
window.open('/TempReports/tempReport.pdf' );</script>"

RegisterStartup Script("whateve r", scriptString)

I assume it will work if you drop your sFileName var in there, as well. Worth a try, anyway.

George
"Stephen Witter" <sw*****@enpath med.com> wrote in message
news:7e******** *************** ***@posting.goo gle.com...
I am currently using response.redire ct in a aspx to go to a web page.
What I want is to open the page in a new window. My dotnet code is as
follows:

Dim sFileName as string = "/TempReports/tempReport.pdf"
response.redire ct(sFileName)

This opens in the same frame and I want to use something like
window.open so I can force a new page and control the size of the
window, etc.... One thing I thought about is calling a javascript
function from within a linkbutton. I don't want to use the
attributes.add because the link button already has code.

I have tried:

Dim scriptString As String = "<script language='javas cript'>
{window.open(" & sFileName & ");} </script>"

Response.Write( scriptString)

but the "<script language=javasc ript></script>" doesn't come across as
a string in my code, it actually comes across as an actual script tag
even though it is in quotes.
I have tried:

Response.Write( "<META HTTP-EQUIV=""REFRESH "" Content=""0;URL =" &
sFileName & """ target=""_blank "">")

to at least get it to open in a new window but I can't get it to work.
Even though I have the target=""_blank "" it still opens in the same
frame.

Any suggestions?


Nov 18 '05 #2
Thanks for your reply. The questions I posted was a process that was
a second choice for me because I couldn't do something I wanted to do
in a web form. As it turns out the reason I couldn't do it the way I
wanted to had to do with misspelling an event name. The event in
dotnet was OnSelectedIndex Changed. I was spelling it
OnSelectedIndex Change.

Funny, it took me almost three weeks to catch that I didn't have a "d"
on the end of my event.

shesh...

"George" <------@----.---> wrote in message news:<fL******* **************@ bgtnsc04-news.ops.worldn et.att.net>...
I think you have to lose the braces { }, and register the script.

Dim scriptString As String = "<script language='JavaS cript'>
window.open('/TempReports/tempReport.pdf' );</script>"

RegisterStartup Script("whateve r", scriptString)

I assume it will work if you drop your sFileName var in there, as well. Worth a try, anyway.

George
"Stephen Witter" <sw*****@enpath med.com> wrote in message
news:7e******** *************** ***@posting.goo gle.com...
I am currently using response.redire ct in a aspx to go to a web page.
What I want is to open the page in a new window. My dotnet code is as
follows:

Dim sFileName as string = "/TempReports/tempReport.pdf"
response.redire ct(sFileName)

This opens in the same frame and I want to use something like
window.open so I can force a new page and control the size of the
window, etc.... One thing I thought about is calling a javascript
function from within a linkbutton. I don't want to use the
attributes.add because the link button already has code.

I have tried:

Dim scriptString As String = "<script language='javas cript'>
{window.open(" & sFileName & ");} </script>"

Response.Write( scriptString)

but the "<script language=javasc ript></script>" doesn't come across as
a string in my code, it actually comes across as an actual script tag
even though it is in quotes.
I have tried:

Response.Write( "<META HTTP-EQUIV=""REFRESH "" Content=""0;URL =" &
sFileName & """ target=""_blank "">")

to at least get it to open in a new window but I can't get it to work.
Even though I have the target=""_blank "" it still opens in the same
frame.

Any suggestions?

Nov 18 '05 #3
Been there. Done that. ;-)
"Stephen Witter" <sw*****@enpath med.com> wrote in message
news:7e******** *************** ***@posting.goo gle.com...
Thanks for your reply. The questions I posted was a process that was
a second choice for me because I couldn't do something I wanted to do
in a web form. As it turns out the reason I couldn't do it the way I
wanted to had to do with misspelling an event name. The event in
dotnet was OnSelectedIndex Changed. I was spelling it
OnSelectedIndex Change.

Funny, it took me almost three weeks to catch that I didn't have a "d"
on the end of my event.

shesh...

"George" <------@----.---> wrote in message

news:<fL******* **************@ bgtnsc04-news.ops.worldn et.att.net>...
I think you have to lose the braces { }, and register the script.

Dim scriptString As String = "<script language='JavaS cript'>
window.open('/TempReports/tempReport.pdf' );</script>"

RegisterStartup Script("whateve r", scriptString)

I assume it will work if you drop your sFileName var in there, as well. Worth a try, anyway.

George
"Stephen Witter" <sw*****@enpath med.com> wrote in message
news:7e******** *************** ***@posting.goo gle.com...
I am currently using response.redire ct in a aspx to go to a web page.
What I want is to open the page in a new window. My dotnet code is as
follows:

Dim sFileName as string = "/TempReports/tempReport.pdf"
response.redire ct(sFileName)

This opens in the same frame and I want to use something like
window.open so I can force a new page and control the size of the
window, etc.... One thing I thought about is calling a javascript
function from within a linkbutton. I don't want to use the
attributes.add because the link button already has code.

I have tried:

Dim scriptString As String = "<script language='javas cript'>
{window.open(" & sFileName & ");} </script>"

Response.Write( scriptString)

but the "<script language=javasc ript></script>" doesn't come across as
a string in my code, it actually comes across as an actual script tag
even though it is in quotes.
I have tried:

Response.Write( "<META HTTP-EQUIV=""REFRESH "" Content=""0;URL =" &
sFileName & """ target=""_blank "">")

to at least get it to open in a new window but I can't get it to work.
Even though I have the target=""_blank "" it still opens in the same
frame.

Any suggestions?

Nov 18 '05 #4

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

Similar topics

11
50644
by: Raphael Gluck | last post by:
Hi everyone I am having a little problem with an asp page. I am trying to create a master/detail page, but on this occasion, it's only a small amount of detail, so i want to create a small page, for the detail, and have that pop up. something you would do for instance to show a link to a larger graphic on your detail page. It's obvious that i am doing something wrong, because instead of opening the new page, in the pop up, the main page...
9
4526
by: CW | last post by:
I wrote an HTML based chat application. The front end is built entirely on HTML + javascript. Essentially, I have a hidden frame that's refreshed frequently and any new messages are displayed in another frame using document.write. My problem is that since chat screen can be obscured by other applications/windows, I have no way of informing users that new messages have arrived other than popping the window to the top using window.focus....
24
3257
by: jonathon | last post by:
Hi all, I have a web app with a popup window for entering data. I don't want to access the web every time this window is opened, as most of the app is AJAX. But I can't figure out how to open a new window and build it with DOM rather than having to provide a src. Even a blank.html as src takes time to fetch. How can I create a popup and dynamically add DOM content without any html at all?
6
4782
by: Erik Steffl | last post by:
I am trying to create a simple custom web spider using mozilla and javascript, the basic functionality is to open a website and then manipulate it using DOM (possibly opening links etc.). it seems like pretty easy task to do, the only pr0oblem is that I can't figure out how to wait for the website to load - I use mozilla security settings to be able to open the window and mainpulate it: var w = window.open("http://google.com", "google...
4
34878
by: GrantS | last post by:
I am having a problem closing a popup window opened modally. When I try to close the window (when the user hits save button and the data has been processed), the Popup window opens as a full screen as a new window. The original window plus the Modally opened Pop remain in a separate window. What I want to do is close the popup and return to the original window with its view state maintained. The control use to fire the popup window...
0
6435
by: Michelle Keys | last post by:
I am trying to call a print function to print a string from a database using javascript. Which is RC_DATA of Varchar2(2500). This is a javascript is not being used. I have a thing that needs to be modified: if(e.CommandName =="Print") { string parsedreceipt = null; parsedreceipt = DecodeReceipt (e.Item.Cells.Text); Session = parsedreceipt;
6
2405
by: Shashi | last post by:
I have developed ASP.Net application using .Net 1.1 Framework. When the user clicks image file through Java script I am using my search window as below. QueryString = "frmMySearchWebForm.aspx?DOBDate=" + txtDOBDt popUp =window.open(QueryString,null, "height=50,width=80,status=no,left =0,top =0,toolbar=no,menubar=no,location=no,scrollbars =yes"); When the user picks a certain customer in the frmMySearchWebForm I am
6
12075
by: bushi | last post by:
hi everyone! i have diplayed my hyperlinks in a iframe.when i redirect to next page.the next page also open in the same frame,but i want to open a new browser window,when i click on the link.actually i 'm using link button control to diplay the hyperlinks.i cant use java script "window.open()".i need some server side code behind the linkbutton,if any one knows plz rply soon.
7
5811
by: Bill H | last post by:
When I do website design I have my screen (on a PC) set for 1600 x 1200 or greater resolution so that I can have as many windows open as I need and not have to flip between them. The issue I have is the the IE7 window is never a consistant size because I resize it as I am using it. I would like to be able to open up a blank IE 7 window and have it set to a specific size each time so that I can see the pages I am working on in the same...
0
8888
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
8752
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,...
1
9174
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,...
0
8096
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6702
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
4782
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3221
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
2
2634
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2157
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.