473,379 Members | 1,201 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,379 software developers and data experts.

Open Page

Wes
This should be really simple ... but how to do it has been
eluding me ...

I am writing an ASP.NET application and am using
ASP.ImageButtons & ASP.Buttons. Instead of redirecting to
another page (ie. Response.Redirect("xxx.htm")) I want to
open the page in another window. Sounds pretty basic,
but .....

If you can help, I'd sure appreciate it.

Thanks,

Wes
Jul 19 '05 #1
1 3185
You should use an html image link instead of an asp.net
control if you are just redirecting to a new page. It is
less weight. Opening a new browser is done on the client-
side so the only way you could get an asp.net control to
open a new page is to dynamically write javascript to the
page to open a new window when the button was clicked. (I
think)

Anyways here is some javascript code and how you would
call it in a page to open an new window.

Javascript code:
<!-- Begin
function NewWindow(mypage, myname, w, h, scroll) {
var winl = (screen.width - w) / 2;
var wint = (screen.height -
h) /2;winprops='height='+h+',width='+w+',top='+wint+', left
='+winl+',scrollbars='+scroll+',resizable'
win = window.open(mypage, myname, winprops)
// <li><a
href="../Conferences/2002_National_Conference/index1.asp">2
002 CSEPP National Conference</a> June 26-27, 2002, in
Lexington, Kentucky
if (parseInt(navigator.appVersion) >= 4) { win.window.focus
(); }
}
// End -->

HTML IMAGE LINK TO PUT IN YOUR PAGE(can be in .net html
page)
NOTE: The window name parameter cannot contain spaces.

<A onmouseover="document['ImgUsage'].src
='MouseOverImage.gif" onmouseout="document
['ImgUsage'].src='NormalImage.gif'" onclick="NewWindow
(this.href,'WindowName','740','530','yes');return false;"
href="usage_policy.asp" >
Hope this helps
-----Original Message-----
This should be really simple ... but how to do it has beeneluding me ...

I am writing an ASP.NET application and am using
ASP.ImageButtons & ASP.Buttons. Instead of redirecting toanother page (ie. Response.Redirect("xxx.htm")) I want to
open the page in another window. Sounds pretty basic,
but .....

If you can help, I'd sure appreciate it.

Thanks,

Wes
.

Jul 19 '05 #2

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

Similar topics

0
by: Unigroup of New York | last post by:
Content-Type: multipart/mixed; boundary="------------C465DF38DCB38DD2AF7117E0" Lines: 327 Date: Tue, 15 Feb 2005 23:36:38 -0500 NNTP-Posting-Host: 24.46.113.251 X-Complaints-To: abuse@cv.net...
18
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...
6
by: lukeo | last post by:
I'm shelling out to an .asp (or htm) page from an application. I want to show this in a window without the address bar, etc... Is there a way I can redirect this page using javascript to a page...
4
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...
3
by: ACaunter | last post by:
Hi all, I need to set a session variable and open a new window with a single click of an asp.net button. My problem is that it always takes two clicks.. one sets the session and the other opens...
6
by: Jack | last post by:
I have a main webpage that has a list of records, each with a link to a window.open function call. As an example, a page that opens is editrecord.aspx?RecordID=34, and another is...
18
by: len.hartley | last post by:
Hi, I am trying to pop-up a window when the user clicks on an image. The problem is that when the user clicks on the image and the window pops up OK, but the window underneath also proceeds to...
11
by: Dave | last post by:
For some reason, the below lines only work on select machines. All machines are running IE6. IE SP's and OS's vary. When it doesn't work, default.aspx (the page that this code is in) opens and...
6
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...
7
by: Peter | last post by:
ASP.NET 2.0 I am trying to open a Word document and Excel document from a dialog web page, what's the best way to do that? I have tried the following: Response.Clear();...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...

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.