473,795 Members | 3,024 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Open in new window

I have an ASP.Net page that does a Response.Redire ct to a code-created url.
Is there any way to code the redirect to open a new window similar to the
Javascript window.open() ? Thanks.

David
Sep 5 '07 #1
21 2407
no. it must be done via javascript or clicking an anchor (with a target).

-- bruce (sqlwork.com)

David C wrote:
I have an ASP.Net page that does a Response.Redire ct to a code-created url.
Is there any way to code the redirect to open a new window similar to the
Javascript window.open() ? Thanks.

David

Sep 5 '07 #2
Along these lines:

I want to have a button that when clicked opens a new window and loads a
specific page. I tried many things, but none worked:

1 - Surround the button with a hyperlink control and no text with
thehyperlink.
2 - put in onclick=http://yada
3 - put in onclick="javasc ript:Window.Ope n(yada, '_blank');"
4 - in the Page_Load put in myButton.Attrib utes.Add("OnCli ck",
"Window.Open('y ada', '_blank')")
....and probably some more attempts.

Nothing worked. Any ideas anyone?

Shelly

P.S. Why didn't they simply have attributes in the button control for the
navigation and the target specification? Yes, they have a space for an
image in the hyperlink control, but that means we would have to have the
image of a button when there is already a button design by default.
"bruce barker" <no****@nospam. comwrote in message
news:Oq******** ******@TK2MSFTN GP06.phx.gbl...
no. it must be done via javascript or clicking an anchor (with a target).

-- bruce (sqlwork.com)

David C wrote:
>I have an ASP.Net page that does a Response.Redire ct to a code-created
url. Is there any way to code the redirect to open a new window similar
to the Javascript window.open() ? Thanks.

David

Sep 5 '07 #3
"Shelly" <sh************ @asap-consult.comwrot e in message
news:13******** *****@corp.supe rnews.com...
Nothing worked. Any ideas anyone?
<input type="button" value="New" onclick="window .open
('http://www.javascript-coder.com/window-popup/javascript-window-open.phtml','my window');"
/>
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Sep 5 '07 #4

"Mark Rae [MVP]" <ma**@markNOSPA Mrae.netwrote in message
news:ul******** ******@TK2MSFTN GP05.phx.gbl...
"Shelly" <sh************ @asap-consult.comwrot e in message
news:13******** *****@corp.supe rnews.com...
>Nothing worked. Any ideas anyone?

<input type="button" value="New" onclick="window .open
('http://www.javascript-coder.com/window-popup/javascript-window-open.phtml','my window');"
....and, oh yes, popups are enabled.
Sep 6 '07 #5

"Mark Rae [MVP]" <ma**@markNOSPA Mrae.netwrote in message
news:ul******** ******@TK2MSFTN GP05.phx.gbl...
"Shelly" <sh************ @asap-consult.comwrot e in message
news:13******** *****@corp.supe rnews.com...
>Nothing worked. Any ideas anyone?

<input type="button" value="New" onclick="window .open
('http://www.javascript-coder.com/window-popup/javascript-window-open.phtml','my window');"
I did this and nothing happened. What I put in was:

<input type="button" value="AA" onclick="window .open('thefile. aspx',
'Company List');" />

I also put in a complete url to a page that exists on the web rather than
'thefile,aspx' (which is in the same directory as the page I ran). Nothing
at all happened when I clicked on "AA".

Shelly
Sep 6 '07 #6
"Shelly" <sh************ @asap-consult.comwrot e in message
news:13******** *****@corp.supe rnews.com...
>
"Mark Rae [MVP]" <ma**@markNOSPA Mrae.netwrote in message
news:ul******** ******@TK2MSFTN GP05.phx.gbl...
>"Shelly" <sh************ @asap-consult.comwrot e in message
news:13******* ******@corp.sup ernews.com...
>>Nothing worked. Any ideas anyone?

<input type="button" value="New" onclick="window .open
('http://www.javascript-coder.com/window-popup/javascript-window-open.phtml','my window');"

...and, oh yes, popups are enabled.

Have you accidentally disabled JavaScript...?

Also, have you unchecked the browser option to display a warning for all
errors...?
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Sep 6 '07 #7

"Mark Rae [MVP]" <ma**@markNOSPA Mrae.netwrote in message
news:uN******** ******@TK2MSFTN GP05.phx.gbl...
>
Have you accidentally disabled JavaScript...?
No. Javascripts are enabled.
Also, have you unchecked the browser option to display a warning for all
errors...?
It is unchecked.

I verified these settings after your post and before I responded.

Shelly
Sep 6 '07 #8
"Shelly" <sh************ @asap-consult.comwrot e in message
news:13******** *****@corp.supe rnews.com...
"Mark Rae [MVP]" <ma**@markNOSPA Mrae.netwrote in message
news:uN******** ******@TK2MSFTN GP05.phx.gbl...
>>
Have you accidentally disabled JavaScript...?

No. Javascripts are enabled.
>Also, have you unchecked the browser option to display a warning for all
errors...?

It is unchecked.

I verified these settings after your post and before I responded.

Hmm - starting to run out of ideas now...

When your page loads, do you see a warning symbol in the bottom left-hand
corner of your screen? If so, there's an error somewhere on the page...

When you do a View Source and find the window.open code, does it "look
right"...? Specifically, are there any carriage returns where you aren't
expecting them...?

Can you create a new page with nothing but the button in question on it -
does it work then...?
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Sep 6 '07 #9
Solved! I need to add "javascript :" before the "window.ope n" command, and
have the full url there.

Now, the next thing is that I want to open a new page in the current window
and pass the info from one of the controls. Also, I want to do this with a
button. In php, I have the button submit, test on that, and then do a

header("Locatio n: new_page_url?ac ct=" . $_POST['acctNumber']);

That sends the the info from the control "acctNumber " via the tag "acct",
and it opens that page in the current window. I want to do the same thing
here (in aspx), extracting the value from the control acctNumber so that it
is known in the next page. How do I do that? (Remember, I am just learning
this stuff)

Shelly
"Mark Rae [MVP]" <ma**@markNOSPA Mrae.netwrote in message
news:%2******** ********@TK2MSF TNGP05.phx.gbl. ..
"Shelly" <sh************ @asap-consult.comwrot e in message
news:13******** *****@corp.supe rnews.com...
>"Mark Rae [MVP]" <ma**@markNOSPA Mrae.netwrote in message
news:uN******* *******@TK2MSFT NGP05.phx.gbl.. .
>>>
Have you accidentally disabled JavaScript...?

No. Javascripts are enabled.
>>Also, have you unchecked the browser option to display a warning for all
errors...?

It is unchecked.

I verified these settings after your post and before I responded.


Hmm - starting to run out of ideas now...

When your page loads, do you see a warning symbol in the bottom left-hand
corner of your screen? If so, there's an error somewhere on the page...

When you do a View Source and find the window.open code, does it "look
right"...? Specifically, are there any carriage returns where you aren't
expecting them...?

Can you create a new page with nothing but the button in question on it -
does it work then...?
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Sep 6 '07 #10

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

Similar topics

18
8851
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...
6
8226
by: Les | last post by:
Hi, I'd like to find out how to use the window.open() script in Fireworks MX. I have posted my question in the Fireworks forum but didn't get any replies. Since it's javascript, maybe someone could help me here...? I'd like to use the window.open() script to open a separate window, because I'd like to hide the menubar and specify the window size as well. So I specify "javascript:window.open(...)" as the HTML link for a hotspot. However,...
10
11242
by: Marshall Dudley | last post by:
When I do the following line in Netscape, the popup loads as it should, but the parent window usually, but not always, reloads as well. <a href="#" onClick="window.open('/cgi-bin/displayimage.cgi?/store/demo/image.jpg&YOUR+PRODUCT%27<b>S+NAME+GOES', 'fullimage', 'WIDTH=420,HEIGHT=405,status=0')"> The original window should not reload, but is, and I have tested it with both version 4.72 and 7.02, and they both do it. IE does not do it....
10
6760
by: David McCulloch | last post by:
The following code opens a new window, but the "resizeTo" doesn't resize it. Why not? (Don't ask why I simply did not open the window with the new size....my original problem was how to open a new window with maximized dimensions!) FYI, I uploaded the same code to: http://tosasoft.com/test/open.htm ========================================
2
3510
by: Samir Pandey | last post by:
Hello, I am using the following javascript code to open a new window. Somehow, IE always opens a new window. It doesn't open target url in the window name given. All i want is, if there is a window "MyWin" already open, then the main window should load the target url in "MyWin" and not open a new window again.
3
24717
by: NeverLift | last post by:
But, if it's not open, I don't want to open it . . . using window.open will open it if it doesn't exist, even if the url in that open is null (the window is then empty -- but it's open). The situation is: A main window opens child windows one at a time as the user requests, each with its own name. The user may click in any child window or the main window to open a summary window, which has a name all windows know. I want to get that...
2
4412
by: Larry R Harrison Jr | last post by:
I have pull-down menus in javascript and I have the code for opening a link in a new window. But I want it to open a full-sized window. I can't figure out the syntax. What I have so far: Menu5_5_1=new Array("'Lonely Church","javascript:window.open ('http://www.photo.net/photodb/photo?photo_id=2640310')","",0,20,300); That works fine, except I can't figure out how to modify it to make it open full-screen.
8
5658
by: Dominic Tocci | last post by:
I'm searching for a way to use window.open on my web page to open a window in firefox that allows the sidebars to work (bookmarks, history, etc). When I use the following: var popWindow=window.open('http://www.yahoo.com','','width=600,height=400,toolbar=1,location=1,menubar=1,resizable=1,titlebar=1,directories=1,status=1,scrollbars=1'); the sidebars are disabled. I click on the buttons for bookmarks and history and they do nothing. I...
7
3676
by: anthony.turcotte | last post by:
Hi, I've looked for a solution to this problem on google, read posts in this newsgroup and I still haven't found anything that could help me. Here's the scenario. 1. User accesses pageA.html 2. User clicks on menu link to open popup.html 3. pageA.html checks if popup.html is already open. It is not, open
13
3339
by: Geoff Fox | last post by:
I am in the final moments of designing a new website. One of the pages (http://www.auditionfactory.com/samples.php) has four links to show sample work. I would like these links to open new browser windows when clicked. I have found scripts that will allow one to open, and a few that claim to all multiples to be opened, but so far nothing that will allow a user to open multiple new windows as they click to see new samples. Does anyone...
0
9519
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
10439
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
10215
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
10165
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
10001
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7541
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
6783
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
5437
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...
3
2920
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.