473,493 Members | 4,347 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

link button and _blank window

a long time ago, someone asked the question:

"I'm using a link button for a Select Button Column in a datagrid.
Based on information within the grid I'm doing a response.redirect to
a different page. However, I'd like to open a new window. How is
this done?"

i had the same problem so here's my fix:

add a hidden input variable to the html form. set value="0" and
runat="server". then in the SelectedIndexChanged event of the
datagrid, set the value="1". add a javascript function to the page
that looks like this:

function openNewWindow() {
if (document.all.openNewWindowFlag.value == 1) {
window.open('mypage.aspx','_blank',width=980,heigh t=650');
}
}

call this function from the onload event on the body tag:

<body onload="javascript: openNewWindow();">

and that's it. there is probably a better way to do this, so if
anyone has another solution, post it.
Nov 17 '05 #1
0 1184

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

Similar topics

10
100461
by: | last post by:
Can I link to another page with a <input type=button> without javascript??? Thanks
7
3479
by: alberta soranzo | last post by:
i'm trying to send a mass-email using microsoft's list builder (http://www.bcentral.com/products/lb/default.asp). my html file is clean and the javascript links work fine in all browsers. when...
3
3480
by: Tim Streater | last post by:
I have, as it might be, this in a frame: <a href="mystuff.html">Click here</a> When I click the link, it loads mystuff.html into the frame, whereas what I want is to replace the whole window...
1
3548
by: John | last post by:
Hi, I'm having a problem opening / downloading csv files when called from a page opened with window.showModalDialog( ). To isolate this problem, I've written 3 files (see below). 1. main.htm...
8
2910
by: Chad | last post by:
Should links automatically appear in the "visited" color as defined by the user's IE settings without having to add any special coding? I have a situation where the link was not changing color...
1
1339
by: Chad | last post by:
First visit all of the links on the page. For each, if the link opens a new window, close it. If it opnes in teh same window, hit back. then hit REFRESH. Notice that while all links SHOULd be...
26
2949
by: Nospam | last post by:
I am trying to open a link in a new template window : <a onclick="windowopen('example.html','example');return false;" href="http://www.example.com" target="_blank"example link</a> such that...
9
37228
by: dwaszak | last post by:
Hi, I have a lot of links in my app ( normal <a href="http://...">some_text</a). I would like to change CSS style of this links, so that they look like normal button (like plain <input...
13
3205
by: amymcdo3 | last post by:
Hi Everyone, I have a popup window that opens when clicking a link. The pop up window asks a question and supplies two buttons, Yes and No. The buttons are images and when the user clicks the...
0
7118
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,...
0
6980
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...
0
7157
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,...
1
6862
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...
0
5452
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,...
0
4579
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...
0
3078
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1397
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 ...
0
282
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...

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.