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

confirm popup box with YES,NO buttons

1
In asp.net code behind page window.confirm method is used to display the confirm popup box with OK CANCEL buttons, on aspx button click based on some condition.

But as per the requirement user want YES NO buttons in the confirm popup.
Apr 2 '14 #1
2 10430
Frinavale
9,735 Expert Mod 8TB
You cannot use server code to display popups in asp.net server-side code.

You have to use the JavaScript confirm instead.

You can prevent the button click event by returning True or False in the client-side onclick event.

For example:
Expand|Select|Wrap|Line Numbers
  1. <asp:Button ID="DeleteItem" 
  2.             runat="server" 
  3.             UseSubmitBehavior="false"
  4.             OnClientClick="return confirm('Are you sure you want to delete the item?');"
  5.             OnClick="DeleteItem_Click" />
  6.  
From what I remember, you need to specify false for the Button.UseSubmitBehavior Property to make this work.

Note that the OnClientClick code allows you to provide JavaScript to execute during the JavaScript (client-side) onclick event so it executes the JavaScript code provided...while the OnClick event specifies the method to call once the server processes the .NET button click event.

-Frinny
Apr 10 '14 #2
You can not change the title of the Confirm buttons.
Ok , Cancel to Yes , No. you would have to make a custom popup having Yes Or No button.
Aug 28 '14 #3

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

Similar topics

2
by: dzeeq | last post by:
Hi, I wonder if it's possible to replace standard text on confirm-popup buttons from 'ok' and 'cancel' to some other captions. If not, is there a way to create quickly custom dialog, with only two...
7
by: Tasha's Dad | last post by:
A description of the problem: 1) Go to a page with various settings and a timeout (forces re-login if over 10 minutes) 2) Before the timeout, make some changes to settings. 3) Press a "reset to...
2
by: Papajo | last post by:
This cookie script has a confirm popup that asks if you want your data saved, it pops when you exit the form, now my question is how can I eliminate the popup? Thanks Joe ...
0
by: Chris Fink | last post by:
My goal is to have an ASP.NET checkbox server tag with it's autopostback set to true, that when clicked will run the checkbox's CheckedChanged event. However, I would like to try to add a...
3
by: JenHu | last post by:
Hi experts, In my asp.net application, I use VB.NET code. I want to have a yes/no button in my popup message box when user click "Submit" button. It will check if the employee is a rehire, if...
18
by: Colin McGuire | last post by:
Hi - this was posted last weekend and unfortunately not resolved. The solutions that were posted almost worked but after another 5 days of working on the code everynight, I am not further ahead....
3
by: Learner | last post by:
Hello, I have two buttons on one of my VehicleDetails.aspx page. Obiviously these two buttons takes the user to two different pages. Now my client is interested in having a linkbutton instead of...
3
smiley22
by: smiley22 | last post by:
How will I be able to change the prompt message of "window.confirm" The buttons are labelled as OK and CANCEL. How will I change the CANCEL to BACK??? Your response will be highly...
1
by: bob9k1 | last post by:
<tr> <td id="entry">Level of Entry:<input type="radio" name="level" value="GCSE" />GCSE</td> <td><input type="radio" name="level" value="AS" />AS</td> <td><input type="radio"...
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: 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
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.