Executing server event and Javascript event

N

Neven Klofutar

Hi,

How can I acomplish following:
I want to create a file on server using onClick server event, and then I
want to open that file in new window using Javascript window.open(). How can
I do it ?

Thanx, Neven
 
K

Kevin Spencer

Create a file in the OnClick event handler, and then use
Page.RegisterStartupScript() to add a JavaScript to the page that opens a
new window (using JavaScript window.open()) with the URL of the image you
just created.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Neither a follower
nor a lender be.
 
B

bruce barker

popup blocks will prevent this code fropm working. instead, have a stand
html button or anchor open the popup. create the file as the first step of
rendering the pop aspx page (instead of posting back the page to create the
file). if you need to postdata back before creating the file, then have a
save button. after the save render the open button.

-- bruce (sqlwork.com)




| Create a file in the OnClick event handler, and then use
| Page.RegisterStartupScript() to add a JavaScript to the page that opens a
| new window (using JavaScript window.open()) with the URL of the image you
| just created.
|
| --
| HTH,
| Kevin Spencer
| .Net Developer
| Microsoft MVP
| Neither a follower
| nor a lender be.
|
| | > Hi,
| >
| > How can I acomplish following:
| > I want to create a file on server using onClick server event, and then I
| > want to open that file in new window using Javascript window.open(). How
| can
| > I do it ?
| >
| > Thanx, Neven
| >
| >
|
|
 

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

Members online

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top