Executing server event and Javascript event

Discussion in 'ASP .Net' started by Neven Klofutar, Dec 9, 2004.

  1. 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
     
    Neven Klofutar, Dec 9, 2004
    #1
    1. Advertisements

  2. 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.
     
    Kevin Spencer, Dec 9, 2004
    #2
    1. Advertisements

  3. Neven Klofutar

    bruce barker Guest

    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
    | >
    | >
    |
    |
     
    bruce barker, Dec 9, 2004
    #3
  4. I get it, ok, thanx !

    Neven
     
    Neven Klofutar, Dec 10, 2004
    #4
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.