Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > How do I detect which button was clicked on "save/open/cancel" dialog?

Reply
Thread Tools

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

 
 
Quinn
Guest
Posts: n/a
 
      07-07-2005
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


 
Reply With Quote
 
 
 
 
Curt_C [MVP]
Guest
Posts: n/a
 
      07-07-2005
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
 
Reply With Quote
 
 
 
 
Patrice
Guest
Posts: n/a
 
      07-07-2005
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
>
>



 
Reply With Quote
 
Aaron Bertrand [SQL Server MVP]
Guest
Posts: n/a
 
      07-07-2005
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
>



 
Reply With Quote
 
Quinn
Guest
Posts: n/a
 
      07-07-2005
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
>



 
Reply With Quote
 
Griff
Guest
Posts: n/a
 
      07-08-2005
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


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
One button to know which button got clicked? bthumber ASP .Net 4 06-25-2010 05:36 PM
Detect which button was clicked on cross-post paulsanna@gmail.com ASP .Net 0 08-16-2006 09:22 PM
Detect which button was clicked? =?Utf-8?B?RGF2ZQ==?= ASP .Net 3 02-26-2004 07:31 PM
Button Collection for Toolbar WebControl - Determinine which button was clicked Jim Mitchell ASP .Net Web Controls 0 07-12-2003 01:02 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57