473,471 Members | 1,856 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

User prompt handling

I have a button (runat=server) with some VB code attached
to its on click event which does data updates.

I now want to add a warning to the user prompting them
whether they really want to perform the update. If they
say Ok then the update proceeds, otherwise it is cancelled.

How is the best way to do this? As far as I see the only
way to get the prompt is to use the JScript Confirm
function but to use this I need to turn off the
runat=server flag which makes the button disappear.

Any help would be much appreciated, Thrud
Nov 18 '05 #1
5 1173
couple ways...
First is a simple CLIENT-SIDE confirm attached to the button.
The other is what I have done. Two buttons. The first simply posts back and
"un-hides" a confirm button while it "hides" the save button. The confirm
button has the actual code to save the info to the DB, not the save button.

--
Curt Christianson
Owner/Lead Developer, DF-Software
www.Darkfalz.com
"Thrud" <an*******@discussions.microsoft.com> wrote in message
news:00****************************@phx.gbl...
I have a button (runat=server) with some VB code attached
to its on click event which does data updates.

I now want to add a warning to the user prompting them
whether they really want to perform the update. If they
say Ok then the update proceeds, otherwise it is cancelled.

How is the best way to do this? As far as I see the only
way to get the prompt is to use the JScript Confirm
function but to use this I need to turn off the
runat=server flag which makes the button disappear.

Any help would be much appreciated, Thrud

Nov 18 '05 #2
Use:

MyButton.Attributes.Add("onClick", "return confirm('Are you sure you want to
continue with this update?')")

Hope this helps,

Mun

--
Munsifali Rashid
http://www.munsplace.com/


"Thrud" <an*******@discussions.microsoft.com> wrote in message
news:00****************************@phx.gbl...
I have a button (runat=server) with some VB code attached
to its on click event which does data updates.

I now want to add a warning to the user prompting them
whether they really want to perform the update. If they
say Ok then the update proceeds, otherwise it is cancelled.

How is the best way to do this? As far as I see the only
way to get the prompt is to use the JScript Confirm
function but to use this I need to turn off the
runat=server flag which makes the button disappear.

Any help would be much appreciated, Thrud

Nov 18 '05 #3
If you don't mind spending a little money, I found this handy, Submit
Confirmer

http://www.silkwebware.net/products/...3-60b9d1fac9c2

Basically a custom .NET control where you assign the control to confirm and
a message, and it pops up the message just like the Javascript type. You can
set the message dynamically as well, and use \n to make breaks, just like
Javascript.

--
Kenneth S. McAndrew
Software Developer, Information Concepts
km*******@infoconcepts.com

"Thrud" <an*******@discussions.microsoft.com> wrote in message
news:00****************************@phx.gbl...
I have a button (runat=server) with some VB code attached
to its on click event which does data updates.

I now want to add a warning to the user prompting them
whether they really want to perform the update. If they
say Ok then the update proceeds, otherwise it is cancelled.

How is the best way to do this? As far as I see the only
way to get the prompt is to use the JScript Confirm
function but to use this I need to turn off the
runat=server flag which makes the button disappear.

Any help would be much appreciated, Thrud

Nov 18 '05 #4
Add this to your button in code behind:

btn.Attributes["onClick"] = "alert('Something');"

Or "confirm" - same thing, but use return.

Regards.
-----Original Message-----
I have a button (runat=server) with some VB code attached
to its on click event which does data updates.

I now want to add a warning to the user prompting them
whether they really want to perform the update. If they
say Ok then the update proceeds, otherwise it is cancelled.
How is the best way to do this? As far as I see the only
way to get the prompt is to use the JScript Confirm
function but to use this I need to turn off the
runat=server flag which makes the button disappear.

Any help would be much appreciated, Thrud
.

Nov 18 '05 #5
Thanks All, especially Munsifali,

MyButton.Attributes.Add("onClick", "return confirm('Are
you sure you want to
continue with this update?')")

works exactly how I want.

-----Original Message-----
Use:

MyButton.Attributes.Add("onClick", "return confirm('Are you sure you want tocontinue with this update?')")

Hope this helps,

Mun

--
Munsifali Rashid
http://www.munsplace.com/


"Thrud" <an*******@discussions.microsoft.com> wrote in messagenews:00****************************@phx.gbl...
I have a button (runat=server) with some VB code attached to its on click event which does data updates.

I now want to add a warning to the user prompting them
whether they really want to perform the update. If they
say Ok then the update proceeds, otherwise it is cancelled.
How is the best way to do this? As far as I see the only
way to get the prompt is to use the JScript Confirm
function but to use this I need to turn off the
runat=server flag which makes the button disappear.

Any help would be much appreciated, Thrud

.

Nov 18 '05 #6

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

Similar topics

13
by: JSE | last post by:
Hello everyone. here's what we have in an html file. <form ..... <input type=button name="comment" onclick=" prompt('enter comment',' ' )" > Is there anyway to get the value...
4
by: jas | last post by:
I have a basic client/server socket situation setup....where the server accepts a connection and then waits for commands. On the client side, I create a socket, connect to the server...then I...
2
by: der | last post by:
Hello all, I want to use fgets() to read lines. Now, if the user has entered more characters than it was supposed to, the next call to fgets() would read these characters, which I don't want to...
5
by: mg | last post by:
The following .exe and its parameters work correctly from the command prompt (it prints x.pdf without prompting the user. acrord32.exe /t "c:\exportfiles\x.pdf" "HP LaserJet 3300 Series PCL 6"...
2
by: ambersaria420 | last post by:
I need to prompt the user to enter ID. I can open up prompt fine using javascript code below. However I am not sure how to get value that user entered in user prompt window. I have to check this...
2
by: tonytony24 | last post by:
Hi All: I was wondering if there's a simple way to call a MS Access Module through either Command Prompt MS Script any other way... Thanks for the response.
2
by: danielboendergaard | last post by:
Hey Im making a homepage in php. I use a html form to put data into mysql and i want to make some buttons which inserts user input values into a textarea. I have used a button like this: <input...
6
by: Shooter4Life8 | last post by:
Hi, I am having trouble figureing out the best way to open a command prompt then write lines to it in VB.NET. Currently I have this code, but it execute's too fast I think because Dim psi As...
12
by: sam | last post by:
hi all, i'm starting to put together a program to simulate the performance of an investment portfolio in a monte carlo manner doing x thousand iterations and extracting data from the results. ...
0
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,...
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,...
0
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...
1
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
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,...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
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 ...

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.