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

Dynamically formed link in a new window.

Hello,

I'm getting hard time solving a problem.

I have a datagrid with checkboxes. Based on the rows checked, when the
user click on link (named export) i want to open a window and export
the data in Word, Excel, etc.

So I need to post back to server, check the rows checked, form the url
with the appropriate querystring (with IDs of each checked rows) and
then open window with that URL.

I've tried several ways with no luck. LinkButton with attributes
"onclick" but it will work then next time you press the link, an
anchor with onserverclick and onclick: onserverclick saves the IDs in
a session var, and onclick opens a window with the "nude" link
(problem is onclick is called *before* onserverclick), etc.

The only viable way is to add a javascript code in the page that open
the window, but it's completely stupid since if the user goes back, a
window will open again, export and open Excel...

I'm really stuck, I'm about to forget the "new window" concept...
except if someone has a suggestion :)

Thanks!

lamazzi
Nov 18 '05 #1
1 1531
Hi
You can very well use javascript ,when the user checked some rows get the rows id and form a querystring in javascript and open a window withthese parameters as query string and if user click again export link you can restrict user to open single window or display message saying "already window open...."

"oleole" wrote:
Hello,

I'm getting hard time solving a problem.

I have a datagrid with checkboxes. Based on the rows checked, when the
user click on link (named export) i want to open a window and export
the data in Word, Excel, etc.

So I need to post back to server, check the rows checked, form the url
with the appropriate querystring (with IDs of each checked rows) and
then open window with that URL.

I've tried several ways with no luck. LinkButton with attributes
"onclick" but it will work then next time you press the link, an
anchor with onserverclick and onclick: onserverclick saves the IDs in
a session var, and onclick opens a window with the "nude" link
(problem is onclick is called *before* onserverclick), etc.

The only viable way is to add a javascript code in the page that open
the window, but it's completely stupid since if the user goes back, a
window will open again, export and open Excel...

I'm really stuck, I'm about to forget the "new window" concept...
except if someone has a suggestion :)

Thanks!

lamazzi

Nov 18 '05 #2

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

Similar topics

2
by: RobG | last post by:
I am trying to dynamically add an onclick to an element, however I just can't get the syntax right. consider the following function: function doClick (evt,x) { // do things with evt and x } ...
20
by: David | last post by:
I have a one-line script to add an onunload event handler to the body of the document. The script is as follows: document.getElementsByTagName("BODY").onunload=function s() {alert("s")} Now...
8
by: simon | last post by:
On code behind file: Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load If Not Page.IsPostBack Then Dim ctrl As New LinkButton ctrl.ID =...
0
by: oleole | last post by:
Hello, I'm getting hard time solving a problem. I have a datagrid with checkboxes. Based on the rows checked, when the user click on link (named export) i want to open a window and export the...
1
by: adamredwards | last post by:
I have a page with some form elements that are dynamically generated. They are inserted into the dom by first cloning a node, changing the values like name, and then inserted with insertBefore(). ...
11
by: GaryB | last post by:
Hi Guys, I've been battling with this one for hours - I hope that you can help me! My code modifies the <aon a page, from a standard document link into a link with a tailored onclick event. ...
1
by: vj | last post by:
How i can populate all fileds dynamically in jsp page based on contents found in xml file? I have written jsp servlets and java class file. i transferred automatic data from jsp to servlet then to...
18
by: sandeepdesai | last post by:
Hi.. i am new to javascripts, i am using a addRow scipt to add rows to a table dynamically. one of the cells(say cell2) in a Nth row needs to be hyperlinked to another script. for example: ...
5
by: TurboRogue | last post by:
So here's the basic premise: I have an html page with a bunch of pictures (pic.html). All of the images are thumbnails of larger photos. I also have another html page which is a pop-up window...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.