Dynamically formed link in a new window.

O

oleole

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
 
G

Guest

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...."
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top