Click here to Skip to main content
15,909,897 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
Hi People!


How am I going to display this kind of error message,"Selected Items will be discarded. Would you like to continue?" Then there will a yes and No button inside of that error message. How to do that?
Posted

 
Share this answer
 
Try this,

Add your message on "onclientclick" in your button,it will provide a message box with your text.

C#
<asp:Button ID="DiscardId" runat="server"  
Text="Discard"  onclick="DiscardId_Click" onclientclick="return confirm('Selected Items will be discarded. Would you like to continue?')" />
 
Share this answer
 
v4
Comments
DarkDreamer08 9-Sep-14 1:33am    
it works great! But I want to change the choices to Yes and No and not OK and Cancel. How am I supposed to do that?
King Fisher 9-Sep-14 4:00am    
Refer this :

http://jsfiddle.net/Xtreu/

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900