Click here to Skip to main content
13,251,998 members (66,690 online)
Rate this:
Please Sign up or sign in to vote.
See more:
how to code for confirm box in code behind file of i click yes it should redirect to index.aspx page if i click no it should remain in same page.can anyone help me
Posted 30-Dec-12 15:45pm
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

You need to read a BASIC ASP.NET book. You can't show UI in your code behind, as it runs on the server. Your client won't see it. You need to do it with javascript. If you need to calculate if you do it, on the server, the best way is to use AJAX to find out. Otherwise, do it on the client and redirect from there.
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

I am totally agree with Christian Graus. But we can have an alternate option for it. For a simple confirmation box we can show a ModelPopupExtender with two buttons saying Confirm and Cancel.
See a sample confirm box:
ASP.NET AJAX ModalPopup to Confirm Delete[^]


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

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web01 | 2.8.171114.1 | Last Updated 30 Dec 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100