473,387 Members | 1,757 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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

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
Jul 22 '05 #1
5 8463
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
Jul 22 '05 #2
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" <qj**@yahoo.com> a écrit dans le message de
news:Ov**************@tk2msftngp13.phx.gbl...
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

Jul 22 '05 #3
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

Jul 22 '05 #4
Thanks guys.But it's too bad we cannot detect.


"Quinn" <qj**@yahoo.com> wrote in message
news:Ov**************@tk2msftngp13.phx.gbl...
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

Jul 22 '05 #5
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
Jul 22 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: SpotNet | last post by:
Hi Newsgroup, I have constructed highly customisable common dialog classes\objects. Decided to extend the Open\Save dialog options with the ability to change the text on all the controls. ...
1
by: Vijay Neelam | last post by:
Hi all, Dim a As String = Response.ContentType Response.Clear() Response.Buffer = True Response.ContentType = "application/msword" Response.AddHeader("content-disposition", "attachment;...
0
by: Dune | last post by:
Hi there, I have an aspx page that allows users to enter several parameters using drop downs and text boxes. The users then press a button that produces an extract based on the parameters they...
3
by: B-Dog | last post by:
I'm checking some files to see if the filenames are in a certain format and if not I want to pull up a dialog box that gives me a save as with the file that is in question. I have all the files in...
3
by: thomasp | last post by:
How do I determine if the user clicked the cancel button in a VB2005 filesavedialog? I have read some newsgroup messages that stated that it would return a 0 length string but this is not the case....
3
by: Trevor | last post by:
I need to find a way to see if the user clicked cancel on a FolderBrowserDialog. Thanks for any help. Trevor From http://www.developmentnow.com/g/38_0_0_0_0_0/dotnet-languages-vb.htm Posted...
2
by: OutdoorGuy | last post by:
Greetings, I have a "newbie" question in relation to opening files from C#. I have a Windows form where I allow the user to type in a file extension in a text box (e.g., "xls"). I then take...
1
by: suitland | last post by:
Hi All, I am using the execCommand(SaveAs) function to save an HTML file as an xls file, and works fine when I open the program and open the file. Is there anyway I can trigger an Open dialog box...
2
by: tejavenkat | last post by:
Hi, I have one scenario i.e Download as csv is there it is a command button when we click on this the save dialog box should be open,Am using javascript how can we do this by using by javascrpt...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.