473,587 Members | 2,230 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 8473
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******** ******@tk2msftn gp13.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******** ******@tk2msftn gp13.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="buttonClick ed" name="buttonCli cked" 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="fnClic ked(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(IDSel ected)
{
hiddenElement = document.getEle mentById('butto nClicked');
hiddenElement.v alue = 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
2345
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. Mainly cause my boss wanted the Open File Dialog's OK button to read 'Import', for all intensive purposes. Open\Save dialogs where constructed purely...
1
1115
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; filename=Document.doc") Response.Write(strDoc) Response.ContentType = a Response.End()
0
2965
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 entered. When this button is pressed and extract is prduced and IE's standard Open/Save dialog should popup so they can navigate to the directory to save...
3
2539
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 a certain directory and if it doesn't meet my criteria then I want to do a "save as" to a different location. How can I do that. I can't seem to...
3
1656
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. It returns the value of the .filename property of the file save dialog. Thanks, Thomas --
3
4084
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 via DevelopmentNow.com Groups http://www.developmentnow.com
2
4400
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 that extension and use that as my filter criteria for the File Open dialog. Once the user selects a file with that extension (from the File Open...
1
7927
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 asking if the user wants to open the file after the file finished downloading?
2
4449
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 .Plz suggest me any body? Thanks & Regards Venkat
0
7915
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
8205
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8339
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7967
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6619
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5712
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5392
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3872
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2347
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.