By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,701 Members | 2,021 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,701 IT Pros & Developers. It's quick & easy.

Open Page

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.