473,405 Members | 2,310 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,405 software developers and data experts.

pop up confirmation help me please

Hi,
I have a function in my code-behind (vb.net) that checks if the file
the user is trying to upload already exists on the server. At that
point I'd like to display a pop up saying 'Are you sure you want to
overwrite the existing file?'. If the user clilcks yes, the function
carries on.

How can I do that? How can I display a javascript popup at that point
of the execution and get the value returned by that popup ?

I'm really struggling on this :(

Thank you

May 26 '06 #1
9 1173
> Hi,
I have a function in my code-behind (vb.net) that checks if the file
the user is trying to upload already exists on the server. At that
point I'd like to display a pop up saying 'Are you sure you want to
overwrite the existing file?'. If the user clilcks yes, the function
carries on.

How can I do that? How can I display a javascript popup at that point
of the execution and get the value returned by that popup ?

I'm really struggling on this :(

Thank you


You can't (as you found out) just show a popup in the middle of
server-side code.

You will need to remember the file server side, redirect to a "are you
sure" page and either remove the stored copy or overwrite the existing
file based on the reaction there (you might also consider giving a new
name).

Server side copy: either a temporary file (but: you will want to
provide some mechanism to delete old copies - as when you never
received an answer to the "are you sure" page), or a Byte[] in Session
(but: this might be big!)

Hans Kesting
May 26 '06 #2
Write the file to a temporary file on your server, then send back your
response asking them if they wish to overwrite. If they do just delete the
old and move the new.

--
Regards

John Timney
Microsoft MVP

"graphicsxp" <sa*************@googlemail.com> wrote in message
news:11*********************@g10g2000cwb.googlegro ups.com...
Hi,
I have a function in my code-behind (vb.net) that checks if the file
the user is trying to upload already exists on the server. At that
point I'd like to display a pop up saying 'Are you sure you want to
overwrite the existing file?'. If the user clilcks yes, the function
carries on.

How can I do that? How can I display a javascript popup at that point
of the execution and get the value returned by that popup ?

I'm really struggling on this :(

Thank you

May 26 '06 #3
"graphicsxp" <sa*************@googlemail.com> wrote in message
news:11*********************@g10g2000cwb.googlegro ups.com...
How can I do that? How can I display a javascript popup at that point
of the execution and get the value returned by that popup ?

I'm really struggling on this :(


http://psacake.com/web/iw.asp
May 26 '06 #4
"graphicsxp" <sa*************@googlemail.com> wrote in message
news:11*********************@g10g2000cwb.googlegro ups.com...

Sorry - ignore my earlier reply - didn't read your OP properly.

Go with Hans' suggestion...
May 26 '06 #5
But yet I was told it is possible to do it in javascript using hidden
fields and stuff like that... have you heard of this ?

May 26 '06 #6
"graphicsxp" <sa*************@googlemail.com> wrote in message
news:11*********************@g10g2000cwb.googlegro ups.com...
But yet I was told it is possible to do it in javascript using hidden
fields and stuff like that... have you heard of this ?


Think about it:

JavaScript runs client-side i.e. on the user's machine.

How can it possibly know whether a file exists on the remote (web)server or
not...?
May 26 '06 #7
no i was not talking about that. you obviously detect that in the code
behind. But then there should be a way to do a postback and display a
javascript confirmbox, get the answer, and do appropriate action
(upload or not the file)

May 26 '06 #8
"graphicsxp" <sa*************@googlemail.com> wrote in message
news:11*********************@j55g2000cwa.googlegro ups.com...
no i was not talking about that. you obviously detect that in the code
behind. But then there should be a way to do a postback and display a
javascript confirmbox, get the answer, and do appropriate action
(upload or not the file)


Of course, and that's what's been suggested - you just can't do it all in
one single postback... :-)
May 26 '06 #9
not to muddy the waters...but wouldn't Ajax work for this scenario? , but of
course that has its own issues

Jose
"graphicsxp" <sa*************@googlemail.com> wrote in message
news:11*********************@g10g2000cwb.googlegro ups.com...
But yet I was told it is possible to do it in javascript using hidden
fields and stuff like that... have you heard of this ?

May 26 '06 #10

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

Similar topics

1
by: PK9 | last post by:
Please help: I have a DropdownList control that has a server-side onSelectedIndexChanged event handler. Before this server-side event handler is run, I'd like a client-side javascript...
3
by: Dennis Allen | last post by:
Hi. On my online ordering form I use browser cookies to keep track of user items. My confirmation page reads: "If any of this information is incorrect, please go back to the order form and...
6
by: Dotnet Guy | last post by:
I want to add a confirmation dialog box before I delete the records in my form. I have a piece of javascript code in html that checks for confirmation. But the main issue lies in calling this...
6
by: Nedu N | last post by:
Hi, I want to have confirmation(Yes/No) on a button of the webform in which there are many validation controls. I want all the validation controls to be triggered first and then Yes/No...
6
by: Dave | last post by:
Hello. I want to prompt user for some action with Yes/No message, I know some tricks in JavaScript, but I need to handle the user answer at server side. Exactly I want to prompt user for...
5
by: Samy | last post by:
Hi There, I have a label in a datagrid which I make it a input type = radio in ItemDataBound so that radio buttons are shown in the datagrid. This is how I have it... ASPX... <asp:Label...
2
by: bienwell | last post by:
Hi all, I still have a problem when using Confirmation box in ASP.NET program. I need to get the value return of YES or NO from confirmation box in Sub function of VB program to do some tasks....
1
by: sweetpotatop | last post by:
Hi, I have an asp.net project written in C# It has a list of records for users to delete and select. When user click the "Delete" button, I would like to ask the user to confirm before I...
4
by: ITCraze | last post by:
Hello everyone, I have a Gridview , whose first column is template colums which contains checkboxes , outside my GridView I a have a delete button. So in this application,when the user check...
7
Haitashi
by: Haitashi | last post by:
I had the following code that would create a javascript confirmation page. This code lived inside a form which wouldn't submit until the user clicked the Ok button. <input type="image"...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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:
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
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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,...

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.