How do I detect which button was clicked on "save/open/cancel" dialog?

Discussion in 'ASP General' started by Quinn, Jul 7, 2005.

  1. Quinn

    Quinn Guest

    When users clicked a unkown mime type link such as Zip on my website, a
    "Save/Open/Cancel" dialog box pops up. Is there a way to detect which button
    users clicked by using ASP? actually I only what to record the "valid"
    click -- when Open/Save was clicked.

    Thanks ahead.

    Quinn
     
    Quinn, Jul 7, 2005
    #1
    1. Advertising

  2. Quinn

    Curt_C [MVP] Guest

    Re: How do I detect which button was clicked on "save/open/cancel"dialog?

    Quinn wrote:
    > When users clicked a unkown mime type link such as Zip on my website, a
    > "Save/Open/Cancel" dialog box pops up. Is there a way to detect which button
    > users clicked by using ASP? actually I only what to record the "valid"
    > click -- when Open/Save was clicked.
    >
    > Thanks ahead.
    >
    > Quinn
    >
    >


    Look in the Request.Form collection, I believe you will get a hit on the
    one that was clicked and the other two will not be in there.

    --
    Curt Christianson
    site: http://www.darkfalz.com
    blog: http://blog.darkfalz.com
     
    Curt_C [MVP], Jul 7, 2005
    #2
    1. Advertising

  3. Quinn

    Patrice Guest

    You can't. The site just streams the file to the browser. What the user does
    with the file is not known by the website as there is no more server side
    interaction...

    Denpending on what you are after you could perhaps let a userdo 3 attemps
    wihtin a quite short period before blocking the download or something
    similar...

    Patrice

    --

    "Quinn" <> a écrit dans le message de
    news:...
    > When users clicked a unkown mime type link such as Zip on my website, a
    > "Save/Open/Cancel" dialog box pops up. Is there a way to detect which

    button
    > users clicked by using ASP? actually I only what to record the "valid"
    > click -- when Open/Save was clicked.
    >
    > Thanks ahead.
    >
    > Quinn
    >
    >
     
    Patrice, Jul 7, 2005
    #3
  4. You cannot. You can't even tell whether or not they clicked on anything at
    all...


    > When users clicked a unkown mime type link such as Zip on my website, a
    > "Save/Open/Cancel" dialog box pops up. Is there a way to detect which
    > button users clicked by using ASP? actually I only what to record the
    > "valid" click -- when Open/Save was clicked.
    >
    > Thanks ahead.
    >
    > Quinn
    >
     
    Aaron Bertrand [SQL Server MVP], Jul 7, 2005
    #4
  5. Quinn

    Quinn Guest

    Thanks guys.But it's too bad we cannot detect.




    "Quinn" <> wrote in message
    news:...
    > When users clicked a unkown mime type link such as Zip on my website, a
    > "Save/Open/Cancel" dialog box pops up. Is there a way to detect which
    > button users clicked by using ASP? actually I only what to record the
    > "valid" click -- when Open/Save was clicked.
    >
    > Thanks ahead.
    >
    > Quinn
    >
     
    Quinn, Jul 7, 2005
    #5
  6. Quinn

    Griff Guest

    But maybe you can...?

    I'm guessing here as I've not tried this, but you could try something like
    this:

    1 - in your form, create a hidden field <input type="hidden"
    id="buttonClicked" name="buttonClicked" value="">

    2 - in each button, have an onclick event to run some javascript which
    passes the id/name of the button, e.g. "buttonA" <input
    onclick="fnClicked(buttonA)"

    3 - have a JavaScript function that selects the hidden field by ID and sets
    the value of this to be the parameter received. Not that familiar with
    JavaScript so the following undoubtably won't work without
    editing/re-writing...

    function fnClicked(IDSelected)
    {
    hiddenElement = document.getElementById('buttonClicked');
    hiddenElement.value = IDSelected;
    }

    Then, when the form submits, you'll have a new input element that has the
    value of the button selected.

    Of course, if the punter has disabled JavaScript then it obviously won't
    work.

    HTH

    Griff
     
    Griff, Jul 8, 2005
    #6
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?RGF2ZQ==?=

    Detect which button was clicked?

    =?Utf-8?B?RGF2ZQ==?=, Feb 26, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    2,436
    =?Utf-8?B?U3VyZXNo?=
    Feb 26, 2004
  2. Replies:
    0
    Views:
    395
  3. tiewknvc9
    Replies:
    12
    Views:
    1,295
    Chris Uppal
    Feb 19, 2007
  4. bthumber
    Replies:
    4
    Views:
    478
    bthumber
    Jun 25, 2010
  5. Yossi

    Which button was clicked and on which row?

    Yossi, Nov 17, 2006, in forum: ASP .Net Datagrid Control
    Replies:
    1
    Views:
    738
    Yossi
    Nov 17, 2006
Loading...

Share This Page