473,545 Members | 2,032 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 9754
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
50568
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...
9
4504
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...
24
3214
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...
6
4774
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...
4
34844
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...
0
6419
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 =...
6
2395
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...
6
12065
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...
7
5797
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...
0
7409
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...
0
7664
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. ...
0
7921
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...
1
7437
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...
0
5982
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...
1
5343
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...
0
3465
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...
1
1900
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
1
1023
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.