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

get confirm box value in asp.net page

i want to confirm for deletion , so i write javascript confirm box from aspx.cs page
how can i get that confirm box boolean reply in aspx.cs page
Expand|Select|Wrap|Line Numbers
  1. ClientScript.RegisterStartupScript("text/jscript".GetType(), "Message", "<script>"+reply+"=Confirm('Do you want to delete or not')</script>;");
Mar 13 '08 #1
5 3457
debasisdas
8,127 Expert 4TB
HI praveengaur

Welcome to TheScripts family.

Feel free to post questions in the related forum only by choosing from under the blue bar on the top of your page.

Please follow the posting guidelines in every new post/reply.

Please specify your post/question clearly.Please use proper code tags in all your codes.

Regards
Debasis
Mar 13 '08 #2
Plater
7,872 Expert 4TB
In your javascript, trigger a postback on succes or a "return false;" if they cancel?
Mar 13 '08 #3
In your javascript, trigger a postback on succes or a "return false;" if they cancel?
what should i write in my aspx.cs page
Mar 15 '08 #4
Plater
7,872 Expert 4TB
In the button on your aspx page, you would add the onClientClick attribute.
Probably with something like:
Expand|Select|Wrap|Line Numbers
  1. onClientClick="return Confirm('Whatever message');"
  2.  
Then if they say "ok" any other actions tied to the button will be performed, if they say "cancel", all other button actions will be ignored. (return true or return false)
Mar 17 '08 #5
Frinavale
9,735 Expert Mod 8TB
In the button on your aspx page, you would add the onClientClick attribute.
Probably with something like:
Expand|Select|Wrap|Line Numbers
  1. onClientClick="return Confirm('Whatever message');"
  2.  
Then if they say "ok" any other actions tied to the button will be performed, if they say "cancel", all other button actions will be ignored. (return true or return false)
In other words, Plater's saying that the confirm box returns a true or false value indicating if the user clicked "ok" or "cancel".
When you specify the JavaScript onclick event as:
Expand|Select|Wrap|Line Numbers
  1. onclick=return confirm('whatever message');
  2.  
If the user clicks "cancel", false is returned and the postback is prevented from happening. If the user clicks "ok", true is returned and the postback for the button is executed.

-Frinny
Mar 17 '08 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Logger | last post by:
Help, I’m trying to implement a confirm button on an asp.net page. I have it attached to a asp:button control. In the button1 click event I call the CreateConfirmBox subroutine. The Box comes...
1
by: Muhammad Abdullah | last post by:
Hi am having some problems with the javascript confirm. i have it working fine on one page and it doesnt even pop up at the other. The code on the working page is, private void...
13
by: Chris | last post by:
I can create Javascript confirm message boxes during page creation, etc adding them to the button attributes (many good posts on this!). But how can I add this event after the button is pressed? I...
1
by: freshRecruit | last post by:
Hi, I am having a problem, and is driving me nuts and my deadline is fast approaching. Please do help me.. This is a webapplication with a usercontrol which has some buttons for adding,...
8
by: Dave | last post by:
Hello all, I have been able to use a Javascript alert box in my vb.net web application, for example: Dim msg As String = "Hello, world." Dim alertScript As String = "<script...
8
by: rn5a | last post by:
I have gone through a no. of posts in this NewsGroup regarding my problem but alas, couldn't come across one which would have helped me in resolving the issue. My problem is this: An ASPX Form...
7
by: shil | last post by:
Hi all, Can any one direct me in how to use javascript confirm() function when a condition is met from codebehind. I don't want to attach this to a button. When I submit the page, I want to...
2
by: thirunavukarasukm | last post by:
Hai.... "i want used confirm in javascript in code behind" i am used confirm button ,,,in code behind. if the confirm button worked the function is return the true...
5
by: GiJeet | last post by:
Hello, I'm trying to figure this code out. <input type="submit" onclick="if(!confirm('Are you sure?') return false; "... /> I know that if you return false in an event like this onclick it...
3
by: ghjk | last post by:
I have a web page which is used to enter user data. In there I have 4 buttons named as "Submit, Confirm,Edit,Cancel". User should enter data and click "Submit " button. Then I want to display all...
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...
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
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
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...

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.